/**
 *
 */
import Util;
import OpenApi;
import OpenApiUtil;
import EndpointUtil;

extends OpenApi;


init(config: OpenApi.Config){
  super(config);
  @endpointRule = '';
  
  checkConfig(config);
  @endpoint = getEndpoint('adp', @regionId, @endpointRule, @network, @suffix, @endpointMap, @endpoint);
}

function getEndpoint(productId: string, regionId: string, endpointRule: string, network: string, suffix: string, endpointMap: map[string]string, endpoint: string) throws: string{
  if (!Util.empty(endpoint)) {
    return endpoint;
  }
  
  if (!Util.isUnset(endpointMap) && !Util.empty(endpointMap[regionId])) {
    return endpointMap[regionId];
  }
  return EndpointUtil.getEndpointRules(productId, regionId, endpointRule, network, suffix);
}

model ComponentVersion {
  appVersion?: string(name='appVersion'),
  componentName?: string(name='componentName'),
  componentUID?: string(name='componentUID'),
  description?: string(name='description'),
  documents?: string(name='documents'),
  imagesMapping?: string(name='imagesMapping'),
  namespace?: string(name='namespace'),
  orchestrationType?: string(name='orchestrationType'),
  orchestrationValues?: string(name='orchestrationValues'),
  packageURL?: string(name='packageURL'),
  parentComponent?: boolean(name='parentComponent'),
  platforms?: [
    Platform
  ](name='platforms'),
  readme?: string(name='readme'),
  resources?: string(name='resources'),
  source?: string(name='source'),
  uid?: string(name='uid'),
  version?: string(name='version'),
}

model Disk {
  capacity?: int32(name='capacity'),
  fsType?: string(name='fsType'),
  mountPoint?: string(name='mountPoint'),
  name?: string(name='name'),
  remain?: int32(name='remain'),
  type?: string(name='type'),
}

model ExportPort {
  cidrIP?: string(name='cidrIP', example='0.0.0.0/0'),
  portRange?: string(name='portRange', example='53/65000'),
  protocol?: string(name='protocol', example='all/tcp/udp'),
  unallowed?: boolean(name='unallowed', example='false'),
}

model FoundationComponentReferenceDetail {
  appVersion?: string(name='appVersion'),
  category?: string(name='category'),
  class?: string(name='class'),
  componentDescription?: string(name='componentDescription'),
  componentName?: string(name='componentName'),
  componentReferenceUID?: string(name='componentReferenceUID'),
  componentUID?: string(name='componentUID'),
  componentVersionDescription?: string(name='componentVersionDescription'),
  componentVersionUID?: string(name='componentVersionUID'),
  createdAt?: string(name='createdAt'),
  documents?: string(name='documents'),
  enable?: boolean(name='enable'),
  imagesMapping?: string(name='imagesMapping'),
  namespace?: string(name='namespace'),
  orchestrationType?: string(name='orchestrationType'),
  orchestrationValues?: string(name='orchestrationValues'),
  parentComponent?: boolean(name='parentComponent'),
  parentComponentVersionUID?: string(name='parentComponentVersionUID'),
  priority?: int32(name='priority'),
  provider?: string(name='provider'),
  public?: boolean(name='public'),
  readme?: string(name='readme'),
  relationUID?: string(name='relationUID'),
  releaseName?: string(name='releaseName'),
  resources?: string(name='resources'),
  sequence?: int32(name='sequence'),
  singleton?: boolean(name='singleton'),
  source?: string(name='source'),
  values?: string(name='values'),
  version?: string(name='version'),
}

model FoundationVersion {
  clusterConfigSchema?: string(name='clusterConfigSchema'),
  clusterEngines?: [ 
    {
      infrastructureStatements?: [ 
        {
          default?: boolean(name='default', example='false'),
          distroName?: string(name='distroName', example='CentOS, Ubuntu, Anolis, Kylin, etc'),
          distroVersion?: string(name='distroVersion', example='7.6, 7.9, V10, etc'),
          platform?: Platform(name='platform'),
        }
      ](name='infrastructureStatements'),
      networkList?: [ 
        {
          ipFamilies?: [ string ](name='ipFamilies'),
          name?: string(name='name', example='Calico'),
        }
      ](name='networkList'),
      packageTools?: [ 
        {
          image?: string(name='image'),
          installToolPackages?: [ 
            {
              architecture?: string(name='architecture', example='ENUM:["amd64","arm64"]'),
              os?: string(name='os', example='ENUM:["linux","windows"]'),
              url?: string(name='url'),
            }
          ](name='installToolPackages'),
          name?: string(name='name'),
          packageFormat?: string(name='packageFormat', example='ENUM:["HopctlPackage","CloudImage"]'),
          type?: string(name='type', example='ENUM:["Hopctl","HopctlSealer"]'),
          version?: string(name='version'),
        }
      ](name='packageTools'),
      packages?: [ 
        {
          architecture?: string(name='architecture', example='ENUM:["amd64","arm64"]'),
          os?: string(name='os', example='ENUM:["linux","windows"]'),
          platforms?: [
            Platform
          ](name='platforms'),
          url?: string(name='url'),
        }
      ](name='packages'),
      type?: string(name='type', example='ENUM:["TRIDENT","ACK-D"]'),
      version?: string(name='version'),
    }
  ](name='clusterEngines'),
  defaultClusterConfig?: string(name='defaultClusterConfig'),
  description?: string(name='description'),
  documents?: string(name='documents'),
  driver?: {
    components?: [ 
      {
        name?: string(name='name'),
        version?: string(name='version'),
      }
    ](name='components'),
  }(name='driver'),
  features?: [ string ](name='features'),
  isDefault?: boolean(name='isDefault'),
  labels?: string(name='labels'),
  name?: string(name='name', example='ADP 底座'),
  packageTools?: [ 
    {
      name?: string(name='name'),
      version?: string(name='version'),
    }
  ](name='packageTools'),
  platforms?: [
    Platform
  ](name='platforms'),
  specName?: string(name='specName'),
  status?: string(name='status', example='Testing'),
  tools?: {
    siteSurvey?: {
      clusterCheckerURL?: string(name='clusterCheckerURL'),
      clusterInfoBrief?: string(name='clusterInfoBrief'),
    }(name='siteSurvey'),
  }(name='tools'),
  type?: string(name='type', example='trident'),
  uid?: string(name='uid'),
  userWhiteList?: [ string ](name='userWhiteList'),
  version?: string(name='version'),
}

model GetInstanceInfoResponse {
  annotations?: map[string]string(name='annotations'),
  arch?: string(name='arch'),
  clusterLabels?: map[string]string(name='clusterLabels'),
  clusterTaints?: [ 
    {
      effect?: string(name='effect'),
      key?: string(name='key'),
      value?: string(name='value'),
    }
  ](name='clusterTaints'),
  cpu?: string(name='cpu'),
  dataDisk?: [
    Disk
  ](name='dataDisk'),
  hostName?: string(name='hostName'),
  identifier?: string(name='identifier'),
  imageID?: string(name='imageID'),
  instanceType?: string(name='instanceType'),
  internetBandwidth?: int32(name='internetBandwidth'),
  kernel?: string(name='kernel'),
  labels?: map[string]string(name='labels'),
  macAddress?: string(name='macAddress'),
  memory?: string(name='memory'),
  networkCards?: [ 
    {
      ip?: string(name='ip'),
      name?: string(name='name'),
    }
  ](name='networkCards'),
  os?: string(name='os'),
  osVersion?: string(name='osVersion'),
  privateIP?: string(name='privateIP'),
  publicIP?: string(name='publicIP'),
  rootPassword?: string(name='rootPassword'),
  systemDisk?: [
    Disk
  ](name='systemDisk'),
  systemInfo?: string(name='systemInfo'),
  taints?: [ 
    {
      effect?: string(name='effect'),
      key?: string(name='key'),
      value?: string(name='value'),
    }
  ](name='taints'),
  uid?: string(name='uid'),
}

model GetPayAsYouGoPriceData {
  moduleList?: [ 
    {
      config?: string(name='Config'),
      moduleCode?: string(name='ModuleCode'),
      priceType?: string(name='PriceType'),
    }
  ](name='ModuleList'),
  ownerId?: string(name='OwnerId'),
  productCode?: string(name='ProductCode'),
  productType?: string(name='ProductType'),
  region?: string(name='Region'),
  subscriptionType?: string(name='SubscriptionType'),
}

model InstanceInfo {
  annotations?: map[string]string(name='annotations'),
  arch?: string(name='arch'),
  clusterLabels?: map[string]string(name='clusterLabels'),
  clusterTaints?: [ 
    {
      effect?: string(name='effect'),
      key?: string(name='key'),
      value?: string(name='value'),
    }
  ](name='clusterTaints'),
  clusterUID?: string(name='clusterUID'),
  cpu?: string(name='cpu'),
  createdAt?: string(name='createdAt'),
  dataDisk?: [
    Disk
  ](name='dataDisk'),
  diskConfigAnnotations?: map[string]string(name='diskConfigAnnotations'),
  hostName?: string(name='hostName'),
  identifier?: string(name='identifier'),
  imageID?: string(name='imageID'),
  instanceType?: string(name='instanceType'),
  internetBandwidth?: int32(name='internetBandwidth'),
  kernel?: string(name='kernel'),
  labels?: map[string]string(name='labels'),
  macAddress?: string(name='macAddress'),
  memory?: string(name='memory'),
  networkCards?: [ 
    {
      ip?: string(name='ip'),
      name?: string(name='name'),
    }
  ](name='networkCards'),
  os?: string(name='os'),
  osVersion?: string(name='osVersion'),
  privateIP?: string(name='privateIP'),
  publicIP?: string(name='publicIP'),
  rootPassword?: string(name='rootPassword'),
  systemDisk?: [
    Disk
  ](name='systemDisk'),
  systemInfo?: string(name='systemInfo'),
  taints?: [ 
    {
      effect?: string(name='effect'),
      key?: string(name='key'),
      value?: string(name='value'),
    }
  ](name='taints'),
  uid?: string(name='uid'),
}

model LabelSelector {
  matchExpressions?: [ 
    {
      key?: string(name='key', example='key1'),
      operator?: string(name='operator'),
      values?: [ string ](name='values'),
    }
  ](name='matchExpressions'),
  matchLabels?: map[string]string(name='matchLabels', example='key:value'),
}

model Platform {
  architecture?: string(name='architecture'),
  os?: string(name='os'),
}

model ProductComponentRelationDetail {
  appVersion?: string(name='appVersion'),
  category?: string(name='category'),
  class?: string(name='class'),
  componentName?: string(name='componentName'),
  componentOrchestrationValues?: string(name='componentOrchestrationValues'),
  componentUID?: string(name='componentUID'),
  componentVersionSpecUID?: string(name='componentVersionSpecUID'),
  componentVersionSpecValues?: string(name='componentVersionSpecValues'),
  componentVersionUID?: string(name='componentVersionUID'),
  createdAt?: string(name='createdAt'),
  description?: string(name='description'),
  documents?: string(name='documents'),
  enable?: boolean(name='enable'),
  imagesMapping?: string(name='imagesMapping'),
  namespace?: string(name='namespace'),
  orchestrationType?: string(name='orchestrationType'),
  parentComponent?: boolean(name='parentComponent'),
  parentComponentVersionRelationUID?: string(name='parentComponentVersionRelationUID'),
  parentComponentVersionUID?: string(name='parentComponentVersionUID'),
  policy?: {
    multiCluster?: {
      targetClusters?: [ string ](name='targetClusters'),
    }(name='multiCluster'),
  }(name='policy'),
  priority?: int32(name='priority'),
  productVersionUID?: string(name='productVersionUID'),
  provider?: string(name='provider'),
  public?: boolean(name='public'),
  readme?: string(name='readme'),
  relationUID?: string(name='relationUID'),
  releaseName?: string(name='releaseName'),
  resources?: string(name='resources'),
  sequence?: int32(name='sequence'),
  singleton?: boolean(name='singleton'),
  source?: string(name='source'),
  version?: string(name='version'),
}

model Resource {
  cpu?: {
    required?: int32(name='required', example='4'),
  }(name='cpu'),
  hostname?: string(name='hostname'),
  identifier?: string(name='identifier'),
  image?: {
    id?: string(name='id'),
    nameRegex?: string(name='nameRegex', example='^centos_7'),
  }(name='image'),
  instanceType?: string(name='instanceType'),
  memory?: {
    required?: int32(name='required', example='8'),
  }(name='memory'),
  ports?: [
    ExportPort
  ](name='ports'),
  publicIP?: {
    bandwidth?: int32(name='bandwidth', example='100'),
    required?: int32(name='required', example='1'),
  }(name='publicIP'),
  replica?: int32(name='replica'),
  storage?: [ 
    {
      required?: int32(name='required'),
    }
  ](name='storage'),
}

model AddEnvironmentNodesRequest {
  applicationDisk?: string(name='applicationDisk', example='/dev/sdb'),
  cpu?: int32(name='cpu'),
  dataDisk?: [ 
    {
      name?: string(name='name'),
      required?: int32(name='required'),
    }
  ](name='dataDisk'),
  etcdDisk?: string(name='etcdDisk', example='/dev/sdb'),
  hostName?: string(name='hostName'),
  labels?: map[string]any(name='labels'),
  masterPrivateIPs?: [ string ](name='masterPrivateIPs'),
  memory?: int32(name='memory'),
  os?: string(name='os'),
  rootPassword?: string(name='rootPassword'),
  systemDisk?: [ 
    {
      name?: string(name='name'),
      required?: int32(name='required'),
    }
  ](name='systemDisk'),
  taints?: [ 
    {
      effect?: string(name='effect'),
      key?: string(name='key'),
      value?: string(name='value'),
    }
  ](name='taints'),
  tridentSystemDisk?: string(name='tridentSystemDisk', example='/dev/sdb'),
  tridentSystemSizeDisk?: int32(name='tridentSystemSizeDisk', example='80'),
  workerPrivateIPs?: [ string ](name='workerPrivateIPs'),
}

model AddEnvironmentNodesResponseBody = {
  code?: string(name='code'),
  msg?: string(name='msg'),
}

model AddEnvironmentNodesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: AddEnvironmentNodesResponseBody(name='body'),
}

async function addEnvironmentNodesWithOptions(uid: string, request: AddEnvironmentNodesRequest, headers: map[string]string, runtime: Util.RuntimeOptions): AddEnvironmentNodesResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.applicationDisk)) {
    body['applicationDisk'] = request.applicationDisk;
  }
  if (!Util.isUnset(request.cpu)) {
    body['cpu'] = request.cpu;
  }
  if (!Util.isUnset(request.dataDisk)) {
    body['dataDisk'] = request.dataDisk;
  }
  if (!Util.isUnset(request.etcdDisk)) {
    body['etcdDisk'] = request.etcdDisk;
  }
  if (!Util.isUnset(request.hostName)) {
    body['hostName'] = request.hostName;
  }
  if (!Util.isUnset(request.labels)) {
    body['labels'] = request.labels;
  }
  if (!Util.isUnset(request.masterPrivateIPs)) {
    body['masterPrivateIPs'] = request.masterPrivateIPs;
  }
  if (!Util.isUnset(request.memory)) {
    body['memory'] = request.memory;
  }
  if (!Util.isUnset(request.os)) {
    body['os'] = request.os;
  }
  if (!Util.isUnset(request.rootPassword)) {
    body['rootPassword'] = request.rootPassword;
  }
  if (!Util.isUnset(request.systemDisk)) {
    body['systemDisk'] = request.systemDisk;
  }
  if (!Util.isUnset(request.taints)) {
    body['taints'] = request.taints;
  }
  if (!Util.isUnset(request.tridentSystemDisk)) {
    body['tridentSystemDisk'] = request.tridentSystemDisk;
  }
  if (!Util.isUnset(request.tridentSystemSizeDisk)) {
    body['tridentSystemSizeDisk'] = request.tridentSystemSizeDisk;
  }
  if (!Util.isUnset(request.workerPrivateIPs)) {
    body['workerPrivateIPs'] = request.workerPrivateIPs;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'AddEnvironmentNodes',
    version = '2021-07-20',
    protocol = 'HTTPS',
    pathname = `/api/v2/environments/${OpenApiUtil.getEncodeParam(uid)}/nodes`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function addEnvironmentNodes(uid: string, request: AddEnvironmentNodesRequest): AddEnvironmentNodesResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return addEnvironmentNodesWithOptions(uid, request, headers, runtime);
}

model AddEnvironmentProductVersionsRequest {
  productVersionInfoList?: [ 
    {
      namespace?: string(name='namespace'),
      productVersionUID?: string(name='productVersionUID'),
      specUID?: string(name='specUID'),
    }
  ](name='productVersionInfoList'),
  productVersionUIDList?: [ string ](name='productVersionUIDList'),
}

model AddEnvironmentProductVersionsResponseBody = {
  code?: string(name='code', example='Success'),
  msg?: string(name='msg', example='Success'),
}

model AddEnvironmentProductVersionsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: AddEnvironmentProductVersionsResponseBody(name='body'),
}

async function addEnvironmentProductVersionsWithOptions(uid: string, request: AddEnvironmentProductVersionsRequest, headers: map[string]string, runtime: Util.RuntimeOptions): AddEnvironmentProductVersionsResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.productVersionInfoList)) {
    body['productVersionInfoList'] = request.productVersionInfoList;
  }
  if (!Util.isUnset(request.productVersionUIDList)) {
    body['productVersionUIDList'] = request.productVersionUIDList;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'AddEnvironmentProductVersions',
    version = '2021-07-20',
    protocol = 'HTTPS',
    pathname = `/api/v2/environments/${OpenApiUtil.getEncodeParam(uid)}/product-versions`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function addEnvironmentProductVersions(uid: string, request: AddEnvironmentProductVersionsRequest): AddEnvironmentProductVersionsResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return addEnvironmentProductVersionsWithOptions(uid, request, headers, runtime);
}

model AddProductComponentVersionRequest {
  componentVersionSpecUID?: string(name='componentVersionSpecUID'),
  componentVersionSpecValues?: string(name='componentVersionSpecValues'),
  releaseName?: string(name='releaseName', example='component-release'),
}

model AddProductComponentVersionResponseBody = {
  code?: string(name='code', example='Success'),
  data?: {
    uid?: string(name='uid', example='85f035f0-7a56-478c-8869-xxxxxxxxxxxx'),
  }(name='data'),
  msg?: string(name='msg', example='Success'),
}

model AddProductComponentVersionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: AddProductComponentVersionResponseBody(name='body'),
}

async function addProductComponentVersionWithOptions(uid: string, componentVersionUID: string, request: AddProductComponentVersionRequest, headers: map[string]string, runtime: Util.RuntimeOptions): AddProductComponentVersionResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.componentVersionSpecUID)) {
    body['componentVersionSpecUID'] = request.componentVersionSpecUID;
  }
  if (!Util.isUnset(request.componentVersionSpecValues)) {
    body['componentVersionSpecValues'] = request.componentVersionSpecValues;
  }
  if (!Util.isUnset(request.releaseName)) {
    body['releaseName'] = request.releaseName;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'AddProductComponentVersion',
    version = '2021-07-20',
    protocol = 'HTTPS',
    pathname = `/integration/api/v2/product-versions/${OpenApiUtil.getEncodeParam(uid)}/component-versions/${OpenApiUtil.getEncodeParam(componentVersionUID)}`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function addProductComponentVersion(uid: string, componentVersionUID: string, request: AddProductComponentVersionRequest): AddProductComponentVersionResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return addProductComponentVersionWithOptions(uid, componentVersionUID, request, headers, runtime);
}

model AddProductVersionConfigRequest {
  componentReleaseName?: string(name='componentReleaseName'),
  componentVersionUID?: string(name='componentVersionUID', example='9963a9ec-95d0-4e82-88c8-xxxxxxxxxxxx'),
  description?: string(name='description', example='config'),
  name?: string(name='name', example='key'),
  parentComponentReleaseName?: string(name='parentComponentReleaseName'),
  parentComponentVersionUID?: string(name='parentComponentVersionUID', example='d415e042-c4be-4707-9bda-xxxxxxxxxxxx'),
  scope?: string(name='scope'),
  value?: string(name='value', example='value'),
  valueType?: string(name='valueType', example='string'),
}

model AddProductVersionConfigResponseBody = {
  code?: string(name='code', example='Success'),
  data?: {
    uid?: string(name='uid', example='fd460c2f-1d81-428d-81f7-xxxxxxxxxxxx'),
  }(name='data'),
  msg?: string(name='msg', example='Success'),
  requestId?: string(name='requestId', example='41FFEC34-1EFD-5634-B9A9-xxxxxxxxxxxx'),
}

model AddProductVersionConfigResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: AddProductVersionConfigResponseBody(name='body'),
}

async function addProductVersionConfigWithOptions(uid: string, request: AddProductVersionConfigRequest, headers: map[string]string, runtime: Util.RuntimeOptions): AddProductVersionConfigResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.componentReleaseName)) {
    body['componentReleaseName'] = request.componentReleaseName;
  }
  if (!Util.isUnset(request.componentVersionUID)) {
    body['componentVersionUID'] = request.componentVersionUID;
  }
  if (!Util.isUnset(request.description)) {
    body['description'] = request.description;
  }
  if (!Util.isUnset(request.name)) {
    body['name'] = request.name;
  }
  if (!Util.isUnset(request.parentComponentReleaseName)) {
    body['parentComponentReleaseName'] = request.parentComponentReleaseName;
  }
  if (!Util.isUnset(request.parentComponentVersionUID)) {
    body['parentComponentVersionUID'] = request.parentComponentVersionUID;
  }
  if (!Util.isUnset(request.scope)) {
    body['scope'] = request.scope;
  }
  if (!Util.isUnset(request.value)) {
    body['value'] = request.value;
  }
  if (!Util.isUnset(request.valueType)) {
    body['valueType'] = request.valueType;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'AddProductVersionConfig',
    version = '2021-07-20',
    protocol = 'HTTPS',
    pathname = `/api/v2/product-versions/${OpenApiUtil.getEncodeParam(uid)}/configs`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function addProductVersionConfig(uid: string, request: AddProductVersionConfigRequest): AddProductVersionConfigResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return addProductVersionConfigWithOptions(uid, request, headers, runtime);
}

model AddResourceSnapshotRequest {
  name?: string(name='name'),
  clusterUID?: string(name='clusterUID'),
  productVersionUID?: string(name='productVersionUID'),
}

model AddResourceSnapshotResponseBody = {
  code?: string(name='code'),
  msg?: string(name='msg'),
}

model AddResourceSnapshotResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: AddResourceSnapshotResponseBody(name='body'),
}

async function addResourceSnapshotWithOptions(request: AddResourceSnapshotRequest, headers: map[string]string, runtime: Util.RuntimeOptions): AddResourceSnapshotResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.clusterUID)) {
    query['clusterUID'] = request.clusterUID;
  }
  if (!Util.isUnset(request.productVersionUID)) {
    query['productVersionUID'] = request.productVersionUID;
  }

  var body : map[string]any = {};
  if (!Util.isUnset(request.name)) {
    body['name'] = request.name;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'AddResourceSnapshot',
    version = '2021-07-20',
    protocol = 'HTTPS',
    pathname = `/api/v2/resource-snapshots`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function addResourceSnapshot(request: AddResourceSnapshotRequest): AddResourceSnapshotResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return addResourceSnapshotWithOptions(request, headers, runtime);
}

model BatchAddEnvironmentNodesRequest {
  instanceList?: [
    InstanceInfo
  ](name='instanceList'),
  overwrite?: boolean(name='overwrite', example='true覆盖'),
}

model BatchAddEnvironmentNodesResponseBody = {
  code?: string(name='code', example='Success'),
  msg?: string(name='msg', example='Success'),
}

model BatchAddEnvironmentNodesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: BatchAddEnvironmentNodesResponseBody(name='body'),
}

async function batchAddEnvironmentNodesWithOptions(uid: string, request: BatchAddEnvironmentNodesRequest, headers: map[string]string, runtime: Util.RuntimeOptions): BatchAddEnvironmentNodesResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.instanceList)) {
    body['instanceList'] = request.instanceList;
  }
  if (!Util.isUnset(request.overwrite)) {
    body['overwrite'] = request.overwrite;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'BatchAddEnvironmentNodes',
    version = '2021-07-20',
    protocol = 'HTTPS',
    pathname = `/api/v2/environments/${OpenApiUtil.getEncodeParam(uid)}/batch/nodes`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function batchAddEnvironmentNodes(uid: string, request: BatchAddEnvironmentNodesRequest): BatchAddEnvironmentNodesResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return batchAddEnvironmentNodesWithOptions(uid, request, headers, runtime);
}

model BatchAddProductVersionConfigRequest {
  productVersionConfigList?: [ 
    {
      componentReleaseName?: string(name='componentReleaseName'),
      componentVersionUID?: string(name='componentVersionUID'),
      description?: string(name='description'),
      name?: string(name='name'),
      parentComponentReleaseName?: string(name='parentComponentReleaseName'),
      parentComponentVersionUID?: string(name='parentComponentVersionUID'),
      scope?: string(name='scope'),
      value?: string(name='value'),
      valueType?: string(name='valueType'),
    }
  ](name='productVersionConfigList'),
}

model BatchAddProductVersionConfigResponseBody = {
  code?: string(name='code'),
  msg?: string(name='msg'),
}

model BatchAddProductVersionConfigResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: BatchAddProductVersionConfigResponseBody(name='body'),
}

async function batchAddProductVersionConfigWithOptions(uid: string, request: BatchAddProductVersionConfigRequest, headers: map[string]string, runtime: Util.RuntimeOptions): BatchAddProductVersionConfigResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.productVersionConfigList)) {
    body['productVersionConfigList'] = request.productVersionConfigList;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'BatchAddProductVersionConfig',
    version = '2021-07-20',
    protocol = 'HTTPS',
    pathname = `/api/v2/product-versions/${OpenApiUtil.getEncodeParam(uid)}/batch/configs`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function batchAddProductVersionConfig(uid: string, request: BatchAddProductVersionConfigRequest): BatchAddProductVersionConfigResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return batchAddProductVersionConfigWithOptions(uid, request, headers, runtime);
}

model CreateDeliverableRequest {
  foundation?: {
    clusterConfig?: string(name='clusterConfig'),
    foundationReferenceUID?: string(name='foundationReferenceUID', example='529478b4-ce43-4b4b-8073-74dfbb387dac'),
    foundationVersion?: string(name='foundationVersion', example='1.4.2'),
    foundationVersionUID?: string(name='foundationVersionUID', example='b1a4f675-7c2c-4b98-a480-73d272ec4a9b'),
    reusable?: boolean(name='reusable'),
  }(name='foundation'),
  products?: [ 
    {
      namespace?: string(name='namespace'),
      productName?: string(name='productName', example='hpa-it'),
      productType?: string(name='productType', example='own'),
      productUID?: string(name='productUID', example='0cdfafd4-7ee1-4524-9ac5-0746320360c2'),
      productVersion?: string(name='productVersion', example='0.0.3'),
      productVersionSpecName?: string(name='productVersionSpecName'),
      productVersionSpecUID?: string(name='productVersionSpecUID', example='bb0e459d-795c-3eea-ab36-6ca6faaa2cec'),
      productVersionUID?: string(name='productVersionUID', example='5b0e459d-795c-4eea-8836-6ca6fa2a2cec'),
    }
  ](name='products'),
}

model CreateDeliverableResponseBody = {
  code?: string(name='code', example='Success'),
  data?: {
    uid?: string(name='uid', example='deliver-Y08jrzAj0PMk'),
  }(name='data'),
  msg?: string(name='msg', example='succeed in handling request'),
}

model CreateDeliverableResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateDeliverableResponseBody(name='body'),
}

async function createDeliverableWithOptions(request: CreateDeliverableRequest, headers: map[string]string, runtime: Util.RuntimeOptions): CreateDeliverableResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.foundation)) {
    body['foundation'] = request.foundation;
  }
  if (!Util.isUnset(request.products)) {
    body['products'] = request.products;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateDeliverable',
    version = '2021-07-20',
    protocol = 'HTTPS',
    pathname = `/api/v2/delivery/deliverables`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createDeliverable(request: CreateDeliverableRequest): CreateDeliverableResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return createDeliverableWithOptions(request, headers, runtime);
}

model CreateDeliveryInstanceRequest {
  clusterUID?: string(name='clusterUID', example='f222c860-ebc7-4e93-b479-8e7f196deeef'),
  deliverableConfigUID?: string(name='deliverableConfigUID', example='deliver-cfg-x24xj0yDB4X9'),
  deliverableUID?: string(name='deliverableUID', example='deliver-3wEoymP6l4Jo'),
  envUID?: string(name='envUID', example='0f1b6f56-1206-4945-9b8a-a158f9240576'),
  foundation?: {
    clusterConfig?: string(name='clusterConfig'),
    foundationReferenceUID?: string(name='foundationReferenceUID'),
    foundationVersion?: string(name='foundationVersion'),
    foundationVersionUID?: string(name='foundationVersionUID'),
    reusable?: string(name='reusable'),
  }(name='foundation'),
  products?: [ 
    {
      namespace?: string(name='namespace'),
      order?: string(name='order'),
      productName?: string(name='productName'),
      productType?: string(name='productType'),
      productUID?: string(name='productUID'),
      productVersion?: string(name='productVersion'),
      productVersionSpecName?: string(name='productVersionSpecName'),
      productVersionSpecUID?: string(name='productVersionSpecUID'),
      productVersionUID?: string(name='productVersionUID'),
    }
  ](name='products'),
  templateUID?: string(name='templateUID'),
}

model CreateDeliveryInstanceResponseBody = {
  code?: string(name='code', example='Success'),
  data?: {
    uid?: string(name='uid', example='delivery-inst-ggQBEEz85VJv'),
  }(name='data'),
  msg?: string(name='msg', example='succeed in handling request'),
}

model CreateDeliveryInstanceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateDeliveryInstanceResponseBody(name='body'),
}

async function createDeliveryInstanceWithOptions(request: CreateDeliveryInstanceRequest, headers: map[string]string, runtime: Util.RuntimeOptions): CreateDeliveryInstanceResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.clusterUID)) {
    body['clusterUID'] = request.clusterUID;
  }
  if (!Util.isUnset(request.deliverableConfigUID)) {
    body['deliverableConfigUID'] = request.deliverableConfigUID;
  }
  if (!Util.isUnset(request.deliverableUID)) {
    body['deliverableUID'] = request.deliverableUID;
  }
  if (!Util.isUnset(request.envUID)) {
    body['envUID'] = request.envUID;
  }
  if (!Util.isUnset(request.foundation)) {
    body['foundation'] = request.foundation;
  }
  if (!Util.isUnset(request.products)) {
    body['products'] = request.products;
  }
  if (!Util.isUnset(request.templateUID)) {
    body['templateUID'] = request.templateUID;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateDeliveryInstance',
    version = '2021-07-20',
    protocol = 'HTTPS',
    pathname = `/api/v2/delivery/delivery-instances`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createDeliveryInstance(request: CreateDeliveryInstanceRequest): CreateDeliveryInstanceResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return createDeliveryInstanceWithOptions(request, headers, runtime);
}

model CreateDeliveryPackageRequest {
  deliverableUID?: string(name='deliverableUID', example='deliver-PKYgLx7l6VOA'),
  deliveryInstanceUID?: string(name='deliveryInstanceUID'),
  originDeliverableUID?: string(name='originDeliverableUID', example='delivery-pkg-rqYQp1Y4rNXg'),
  packageContentType?: string(name='packageContentType', example='all'),
  packageType?: string(name='packageType', example='full'),
  platform?: string(name='platform', example='linux/amd64'),
}

model CreateDeliveryPackageResponseBody = {
  code?: string(name='code', example='Success'),
  data?: {
    uid?: string(name='uid', example='delivery-pkg-3N4o4j1712OA'),
  }(name='data'),
  msg?: string(name='msg', example='succeed in handling request'),
}

model CreateDeliveryPackageResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateDeliveryPackageResponseBody(name='body'),
}

async function createDeliveryPackageWithOptions(request: CreateDeliveryPackageRequest, headers: map[string]string, runtime: Util.RuntimeOptions): CreateDeliveryPackageResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.deliverableUID)) {
    body['deliverableUID'] = request.deliverableUID;
  }
  if (!Util.isUnset(request.deliveryInstanceUID)) {
    body['deliveryInstanceUID'] = request.deliveryInstanceUID;
  }
  if (!Util.isUnset(request.originDeliverableUID)) {
    body['originDeliverableUID'] = request.originDeliverableUID;
  }
  if (!Util.isUnset(request.packageContentType)) {
    body['packageContentType'] = request.packageContentType;
  }
  if (!Util.isUnset(request.packageType)) {
    body['packageType'] = request.packageType;
  }
  if (!Util.isUnset(request.platform)) {
    body['platform'] = request.platform;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateDeliveryPackage',
    version = '2021-07-20',
    protocol = 'HTTPS',
    pathname = `/api/v2/delivery/delivery-packages`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createDeliveryPackage(request: CreateDeliveryPackageRequest): CreateDeliveryPackageResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return createDeliveryPackageWithOptions(request, headers, runtime);
}

model CreateEnvironmentHeaders {
  commonHeaders?: map[string]string,
  clientToken?: string(name='ClientToken', example='ClientToken'),
}

model CreateEnvironmentRequest {
  annotations?: string(name='annotations'),
  description?: string(name='description'),
  expiredAt?: string(name='expiredAt'),
  location?: string(name='location'),
  name?: string(name='name', example='env-demo'),
  platform?: {
    architecture?: string(name='architecture', example='amd64'),
    os?: string(name='os', example='linux'),
  }(name='platform'),
  platformList?: [
    Platform
  ](name='platformList'),
  productVersionUID?: string(name='productVersionUID', example='2c87c449-7f5e-4ee6-9bb3-xxx'),
  type?: string(name='type', example='production'),
  vendorConfig?: string(name='vendorConfig'),
  vendorType?: string(name='vendorType', example='alicloud'),
}

model CreateEnvironmentResponseBody = {
  code?: string(name='code', example='Success'),
  data?: {
    environmentUID?: string(name='environmentUID', example='b8ec63af-7859-4464-9cff-xxx'),
    vendorConfig?: string(name='vendorConfig'),
  }(name='data'),
  msg?: string(name='msg', example='Success'),
}

model CreateEnvironmentResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateEnvironmentResponseBody(name='body'),
}

async function createEnvironmentWithOptions(request: CreateEnvironmentRequest, headers: CreateEnvironmentHeaders, runtime: Util.RuntimeOptions): CreateEnvironmentResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.annotations)) {
    body['annotations'] = request.annotations;
  }
  if (!Util.isUnset(request.description)) {
    body['description'] = request.description;
  }
  if (!Util.isUnset(request.expiredAt)) {
    body['expiredAt'] = request.expiredAt;
  }
  if (!Util.isUnset(request.location)) {
    body['location'] = request.location;
  }
  if (!Util.isUnset(request.name)) {
    body['name'] = request.name;
  }
  if (!Util.isUnset(request.platform)) {
    body['platform'] = request.platform;
  }
  if (!Util.isUnset(request.platformList)) {
    body['platformList'] = request.platformList;
  }
  if (!Util.isUnset(request.productVersionUID)) {
    body['productVersionUID'] = request.productVersionUID;
  }
  if (!Util.isUnset(request.type)) {
    body['type'] = request.type;
  }
  if (!Util.isUnset(request.vendorConfig)) {
    body['vendorConfig'] = request.vendorConfig;
  }
  if (!Util.isUnset(request.vendorType)) {
    body['vendorType'] = request.vendorType;
  }

  var realHeaders : map[string]string = {};
  if (!Util.isUnset(headers.commonHeaders)) {
    realHeaders = headers.commonHeaders;
  }
  if (!Util.isUnset(headers.clientToken)) {
    realHeaders['ClientToken'] = Util.toJSONString(headers.clientToken);
  }
  var req = new OpenApi.OpenApiRequest{ 
    headers = realHeaders,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateEnvironment',
    version = '2021-07-20',
    protocol = 'HTTPS',
    pathname = `/api/v2/environments`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createEnvironment(request: CreateEnvironmentRequest): CreateEnvironmentResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers = new CreateEnvironmentHeaders{};
  return createEnvironmentWithOptions(request, headers, runtime);
}

model CreateEnvironmentLicenseRequest {
  companyName?: string(name='companyName'),
  contact?: string(name='contact', example='188xxxxxxxx'),
  description?: string(name='description'),
  expireTime?: string(name='expireTime'),
  licenseQuota?: {
    clusterQuota?: {
      cpuCoreLimit?: long(name='cpuCoreLimit', example='100'),
    }(name='clusterQuota'),
    customQuotas?: [ 
      {
        description?: string(name='description', example='value of name'),
        key?: string(name='key', example='name'),
        value?: string(name='value', example='aliyun'),
      }
    ](name='customQuotas'),
  }(name='licenseQuota'),
  machineFingerprint?: string(name='machineFingerprint', example='xxxxx'),
  name?: string(name='name'),
  productVersionUID?: string(name='productVersionUID', example='e61f944c-c021-46bd-a877-xxxxxxxxxxxx'),
  scenario?: string(name='scenario'),
  scope?: string(name='scope', example='foundation'),
  type?: string(name='type', example='OnTrial,Production'),
}

model CreateEnvironmentLicenseResponseBody = {
  code?: string(name='code', example='Success'),
  data?: {
    uid?: string(name='uid', example='3c35c6fa-c080-444b-89ac-xxxxxxxxxxxx'),
  }(name='data'),
  msg?: string(name='msg', example='Success'),
}

model CreateEnvironmentLicenseResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateEnvironmentLicenseResponseBody(name='body'),
}

async function createEnvironmentLicenseWithOptions(uid: string, request: CreateEnvironmentLicenseRequest, headers: map[string]string, runtime: Util.RuntimeOptions): CreateEnvironmentLicenseResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.companyName)) {
    body['companyName'] = request.companyName;
  }
  if (!Util.isUnset(request.contact)) {
    body['contact'] = request.contact;
  }
  if (!Util.isUnset(request.description)) {
    body['description'] = request.description;
  }
  if (!Util.isUnset(request.expireTime)) {
    body['expireTime'] = request.expireTime;
  }
  if (!Util.isUnset(request.licenseQuota)) {
    body['licenseQuota'] = request.licenseQuota;
  }
  if (!Util.isUnset(request.machineFingerprint)) {
    body['machineFingerprint'] = request.machineFingerprint;
  }
  if (!Util.isUnset(request.name)) {
    body['name'] = request.name;
  }
  if (!Util.isUnset(request.productVersionUID)) {
    body['productVersionUID'] = request.productVersionUID;
  }
  if (!Util.isUnset(request.scenario)) {
    body['scenario'] = request.scenario;
  }
  if (!Util.isUnset(request.scope)) {
    body['scope'] = request.scope;
  }
  if (!Util.isUnset(request.type)) {
    body['type'] = request.type;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateEnvironmentLicense',
    version = '2021-07-20',
    protocol = 'HTTPS',
    pathname = `/api/v2/environments/${OpenApiUtil.getEncodeParam(uid)}/licenses`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createEnvironmentLicense(uid: string, request: CreateEnvironmentLicenseRequest): CreateEnvironmentLicenseResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return createEnvironmentLicenseWithOptions(uid, request, headers, runtime);
}

model CreateFoundationReferenceRequest {
  clusterConfig?: string(name='clusterConfig'),
  componentConfigs?: [ 
    {
      componentVersionUID?: string(name='componentVersionUID'),
      orchestrationValues?: string(name='orchestrationValues'),
    }
  ](name='componentConfigs'),
  foundationReferenceConfigs?: [ 
    {
      componentReleaseName?: string(name='componentReleaseName'),
      configType?: string(name='configType'),
      name?: string(name='name'),
      value?: string(name='value'),
    }
  ](name='foundationReferenceConfigs'),
  foundationVersionUID?: string(name='foundationVersionUID', example='796f9044-8684-4de5-9b12-xxxx'),
  originFoundationReferenceUID?: string(name='originFoundationReferenceUID'),
}

model CreateFoundationReferenceResponseBody = {
  code?: string(name='code', example='Success'),
  data?: {
    uid?: string(name='uid', example='ccbec64f-bc0e-4c21-9d24-xxx'),
  }(name='data'),
  msg?: string(name='msg', example='Success'),
}

model CreateFoundationReferenceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateFoundationReferenceResponseBody(name='body'),
}

async function createFoundationReferenceWithOptions(request: CreateFoundationReferenceRequest, headers: map[string]string, runtime: Util.RuntimeOptions): CreateFoundationReferenceResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.clusterConfig)) {
    body['clusterConfig'] = request.clusterConfig;
  }
  if (!Util.isUnset(request.componentConfigs)) {
    body['componentConfigs'] = request.componentConfigs;
  }
  if (!Util.isUnset(request.foundationReferenceConfigs)) {
    body['foundationReferenceConfigs'] = request.foundationReferenceConfigs;
  }
  if (!Util.isUnset(request.foundationVersionUID)) {
    body['foundationVersionUID'] = request.foundationVersionUID;
  }
  if (!Util.isUnset(request.originFoundationReferenceUID)) {
    body['originFoundationReferenceUID'] = request.originFoundationReferenceUID;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateFoundationReference',
    version = '2021-07-20',
    protocol = 'HTTPS',
    pathname = `/api/v2/foundation-references`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createFoundationReference(request: CreateFoundationReferenceRequest): CreateFoundationReferenceResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return createFoundationReferenceWithOptions(request, headers, runtime);
}

model CreateProductHeaders {
  commonHeaders?: map[string]string,
  clientToken?: string(name='ClientToken', example='ClientToken'),
}

model CreateProductRequest {
  categories?: [ string ](name='categories'),
  description?: string(name='description'),
  displayName?: string(name='displayName'),
  foundationVersionUID?: string(name='foundationVersionUID', example='796f9044-8684-4de5-9b12-xxxxxxxxxxxx'),
  productName?: string(name='productName', example='product-name'),
  vendor?: string(name='vendor'),
  withoutProductVersion?: boolean(name='withoutProductVersion'),
}

model CreateProductResponseBody = {
  code?: string(name='code', example='Success'),
  data?: {
    uid?: string(name='uid', example='bb6d7d5b-2ead-4102-8a30-xxxxxxxxxxxx'),
  }(name='data'),
  msg?: string(name='msg', example='Success'),
}

model CreateProductResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateProductResponseBody(name='body'),
}

async function createProductWithOptions(request: CreateProductRequest, headers: CreateProductHeaders, runtime: Util.RuntimeOptions): CreateProductResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.categories)) {
    body['categories'] = request.categories;
  }
  if (!Util.isUnset(request.description)) {
    body['description'] = request.description;
  }
  if (!Util.isUnset(request.displayName)) {
    body['displayName'] = request.displayName;
  }
  if (!Util.isUnset(request.foundationVersionUID)) {
    body['foundationVersionUID'] = request.foundationVersionUID;
  }
  if (!Util.isUnset(request.productName)) {
    body['productName'] = request.productName;
  }
  if (!Util.isUnset(request.vendor)) {
    body['vendor'] = request.vendor;
  }
  if (!Util.isUnset(request.withoutProductVersion)) {
    body['withoutProductVersion'] = request.withoutProductVersion;
  }

  var realHeaders : map[string]string = {};
  if (!Util.isUnset(headers.commonHeaders)) {
    realHeaders = headers.commonHeaders;
  }
  if (!Util.isUnset(headers.clientToken)) {
    realHeaders['ClientToken'] = Util.toJSONString(headers.clientToken);
  }
  var req = new OpenApi.OpenApiRequest{ 
    headers = realHeaders,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateProduct',
    version = '2021-07-20',
    protocol = 'HTTPS',
    pathname = `/integration/api/v2/products`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createProduct(request: CreateProductRequest): CreateProductResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers = new CreateProductHeaders{};
  return createProductWithOptions(request, headers, runtime);
}

model CreateProductDeploymentRequest {
  environmentUID?: string(name='environmentUID', example='3c923aa6-2fcf-40cc-8412-xxx'),
  namespace?: string(name='namespace'),
  oldProductVersionUID?: string(name='oldProductVersionUID', example='93cf4ffe-9dc6-4a84-ba8d-xxx'),
  packageConfig?: string(name='packageConfig'),
  packageUID?: string(name='packageUID', example='474daaa5-0a7b-4af9-8080-xxx'),
  productVersionUID?: string(name='productVersionUID', example='bef2616b-b469-4a6f-b405-xxx'),
  timeout?: long(name='timeout'),
}

model CreateProductDeploymentResponseBody = {
  code?: string(name='code', example='Success'),
  data?: {
    uid?: string(name='uid', example='5699b683-075a-4c51-a78c-xxx'),
  }(name='data'),
  msg?: string(name='msg', example='Success'),
}

model CreateProductDeploymentResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateProductDeploymentResponseBody(name='body'),
}

async function createProductDeploymentWithOptions(request: CreateProductDeploymentRequest, headers: map[string]string, runtime: Util.RuntimeOptions): CreateProductDeploymentResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.environmentUID)) {
    body['environmentUID'] = request.environmentUID;
  }
  if (!Util.isUnset(request.namespace)) {
    body['namespace'] = request.namespace;
  }
  if (!Util.isUnset(request.oldProductVersionUID)) {
    body['oldProductVersionUID'] = request.oldProductVersionUID;
  }
  if (!Util.isUnset(request.packageConfig)) {
    body['packageConfig'] = request.packageConfig;
  }
  if (!Util.isUnset(request.packageUID)) {
    body['packageUID'] = request.packageUID;
  }
  if (!Util.isUnset(request.productVersionUID)) {
    body['productVersionUID'] = request.productVersionUID;
  }
  if (!Util.isUnset(request.timeout)) {
    body['timeout'] = request.timeout;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateProductDeployment',
    version = '2021-07-20',
    protocol = 'HTTPS',
    pathname = `/api/v2/product-instances/deployments`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createProductDeployment(request: CreateProductDeploymentRequest): CreateProductDeploymentResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return createProductDeploymentWithOptions(request, headers, runtime);
}

model CreateProductVersionRequest {
  baseProductVersionUID?: string(name='baseProductVersionUID'),
  version?: string(name='version'),
  withoutBaseProductVersion?: boolean(name='withoutBaseProductVersion'),
}

model CreateProductVersionResponseBody = {
  code?: string(name='code'),
  data?: {
    uid?: string(name='uid'),
  }(name='data'),
  msg?: string(name='msg'),
}

model CreateProductVersionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateProductVersionResponseBody(name='body'),
}

async function createProductVersionWithOptions(uid: string, request: CreateProductVersionRequest, headers: map[string]string, runtime: Util.RuntimeOptions): CreateProductVersionResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.baseProductVersionUID)) {
    query['baseProductVersionUID'] = request.baseProductVersionUID;
  }

  var body : map[string]any = {};
  if (!Util.isUnset(request.version)) {
    body['version'] = request.version;
  }
  if (!Util.isUnset(request.withoutBaseProductVersion)) {
    body['withoutBaseProductVersion'] = request.withoutBaseProductVersion;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateProductVersion',
    version = '2021-07-20',
    protocol = 'HTTPS',
    pathname = `/integration/api/v2/products/${OpenApiUtil.getEncodeParam(uid)}/versions`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createProductVersion(uid: string, request: CreateProductVersionRequest): CreateProductVersionResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return createProductVersionWithOptions(uid, request, headers, runtime);
}

model CreateProductVersionPackageHeaders {
  commonHeaders?: map[string]string,
  clientToken?: string(name='ClientToken'),
}

model CreateProductVersionPackageRequest {
  clusterEngineType?: string(name='clusterEngineType', example='TRIDENT'),
  foundationReferenceUID?: string(name='foundationReferenceUID'),
  oldFoundationReferenceUID?: string(name='oldFoundationReferenceUID'),
  oldProductVersionUID?: string(name='oldProductVersionUID', example='5f1261e4-7462-48d8-8f9d-xxxxxxxxxxxx'),
  packageContentType?: string(name='packageContentType', example='all'),
  packageToolType?: string(name='packageToolType', example='Hopctl'),
  packageType?: string(name='packageType', example='full'),
  platform?: string(name='platform', example='linux/amd64'),
}

model CreateProductVersionPackageResponseBody = {
  code?: string(name='code', example='Success'),
  data?: {
    uid?: string(name='uid', example='1c33e7b7-2df8-4632-9f94-xxxxxxxxxxxx'),
  }(name='data'),
  msg?: string(name='msg', example='Success'),
}

model CreateProductVersionPackageResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateProductVersionPackageResponseBody(name='body'),
}

/**
  * @deprecated
  *
  * @param request CreateProductVersionPackageRequest
  * @param headers CreateProductVersionPackageHeaders
  * @param runtime runtime options for this request RuntimeOptions
  * @return CreateProductVersionPackageResponse
 */
// Deprecated
async function createProductVersionPackageWithOptions(uid: string, request: CreateProductVersionPackageRequest, headers: CreateProductVersionPackageHeaders, runtime: Util.RuntimeOptions): CreateProductVersionPackageResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.clusterEngineType)) {
    query['clusterEngineType'] = request.clusterEngineType;
  }
  if (!Util.isUnset(request.foundationReferenceUID)) {
    query['foundationReferenceUID'] = request.foundationReferenceUID;
  }
  if (!Util.isUnset(request.oldFoundationReferenceUID)) {
    query['oldFoundationReferenceUID'] = request.oldFoundationReferenceUID;
  }
  if (!Util.isUnset(request.oldProductVersionUID)) {
    query['oldProductVersionUID'] = request.oldProductVersionUID;
  }
  if (!Util.isUnset(request.packageContentType)) {
    query['packageContentType'] = request.packageContentType;
  }
  if (!Util.isUnset(request.packageToolType)) {
    query['packageToolType'] = request.packageToolType;
  }
  if (!Util.isUnset(request.packageType)) {
    query['packageType'] = request.packageType;
  }
  if (!Util.isUnset(request.platform)) {
    query['platform'] = request.platform;
  }

  var realHeaders : map[string]string = {};
  if (!Util.isUnset(headers.commonHeaders)) {
    realHeaders = headers.commonHeaders;
  }
  if (!Util.isUnset(headers.clientToken)) {
    realHeaders['ClientToken'] = Util.toJSONString(headers.clientToken);
  }
  var req = new OpenApi.OpenApiRequest{ 
    headers = realHeaders,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateProductVersionPackage',
    version = '2021-07-20',
    protocol = 'HTTPS',
    pathname = `/api/v2/hosting/product-versions/${OpenApiUtil.getEncodeParam(uid)}/packages`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
  * @deprecated
  *
  * @param request CreateProductVersionPackageRequest
  * @return CreateProductVersionPackageResponse
 */
// Deprecated
async function createProductVersionPackage(uid: string, request: CreateProductVersionPackageRequest): CreateProductVersionPackageResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers = new CreateProductVersionPackageHeaders{};
  return createProductVersionPackageWithOptions(uid, request, headers, runtime);
}

model DeleteEnvironmentResponseBody = {
  code?: string(name='code', example='Success'),
  msg?: string(name='msg', example='Success'),
}

model DeleteEnvironmentResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteEnvironmentResponseBody(name='body'),
}

async function deleteEnvironmentWithOptions(uid: string, headers: map[string]string, runtime: Util.RuntimeOptions): DeleteEnvironmentResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApi.Params{
    action = 'DeleteEnvironment',
    version = '2021-07-20',
    protocol = 'HTTPS',
    pathname = `/api/v2/environments/${OpenApiUtil.getEncodeParam(uid)}`,
    method = 'DELETE',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteEnvironment(uid: string): DeleteEnvironmentResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return deleteEnvironmentWithOptions(uid, headers, runtime);
}

model DeleteEnvironmentLicenseResponseBody = {
  code?: string(name='code'),
  msg?: string(name='msg'),
  requestId?: string(name='requestId'),
}

model DeleteEnvironmentLicenseResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteEnvironmentLicenseResponseBody(name='body'),
}

async function deleteEnvironmentLicenseWithOptions(uid: string, licenseUID: string, headers: map[string]string, runtime: Util.RuntimeOptions): DeleteEnvironmentLicenseResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApi.Params{
    action = 'DeleteEnvironmentLicense',
    version = '2021-07-20',
    protocol = 'HTTPS',
    pathname = `/api/v2/environments/${OpenApiUtil.getEncodeParam(uid)}/licenses/${OpenApiUtil.getEncodeParam(licenseUID)}`,
    method = 'DELETE',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteEnvironmentLicense(uid: string, licenseUID: string): DeleteEnvironmentLicenseResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return deleteEnvironmentLicenseWithOptions(uid, licenseUID, headers, runtime);
}

model DeleteEnvironmentNodeResponseBody = {
  code?: string(name='code', example='Success'),
  msg?: string(name='msg', example='Success'),
}

model DeleteEnvironmentNodeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteEnvironmentNodeResponseBody(name='body'),
}

async function deleteEnvironmentNodeWithOptions(uid: string, nodeUID: string, headers: map[string]string, runtime: Util.RuntimeOptions): DeleteEnvironmentNodeResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApi.Params{
    action = 'DeleteEnvironmentNode',
    version = '2021-07-20',
    protocol = 'HTTPS',
    pathname = `/api/v2/environments/${OpenApiUtil.getEncodeParam(uid)}/nodes/${OpenApiUtil.getEncodeParam(nodeUID)}`,
    method = 'DELETE',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteEnvironmentNode(uid: string, nodeUID: string): DeleteEnvironmentNodeResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return deleteEnvironmentNodeWithOptions(uid, nodeUID, headers, runtime);
}

model DeleteEnvironmentProductVersionResponseBody = {
  code?: string(name='code', example='Success'),
  msg?: string(name='msg', example='Success'),
}

model DeleteEnvironmentProductVersionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteEnvironmentProductVersionResponseBody(name='body'),
}

async function deleteEnvironmentProductVersionWithOptions(uid: string, productVersionUID: string, headers: map[string]string, runtime: Util.RuntimeOptions): DeleteEnvironmentProductVersionResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApi.Params{
    action = 'DeleteEnvironmentProductVersion',
    version = '2021-07-20',
    protocol = 'HTTPS',
    pathname = `/api/v2/environments/${OpenApiUtil.getEncodeParam(uid)}/product-versions/${OpenApiUtil.getEncodeParam(productVersionUID)}`,
    method = 'DELETE',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteEnvironmentProductVersion(uid: string, productVersionUID: string): DeleteEnvironmentProductVersionResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return deleteEnvironmentProductVersionWithOptions(uid, productVersionUID, headers, runtime);
}

model DeleteProductResponseBody = {
  code?: string(name='code', example='Success'),
  msg?: string(name='msg', example='Success'),
}

model DeleteProductResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteProductResponseBody(name='body'),
}

async function deleteProductWithOptions(uid: string, headers: map[string]string, runtime: Util.RuntimeOptions): DeleteProductResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApi.Params{
    action = 'DeleteProduct',
    version = '2021-07-20',
    protocol = 'HTTPS',
    pathname = `/integration/api/v2/products/${OpenApiUtil.getEncodeParam(uid)}`,
    method = 'DELETE',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteProduct(uid: string): DeleteProductResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return deleteProductWithOptions(uid, headers, runtime);
}

model DeleteProductComponentVersionResponseBody = {
  code?: string(name='code', example='Success'),
  msg?: string(name='msg', example='Success'),
}

model DeleteProductComponentVersionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteProductComponentVersionResponseBody(name='body'),
}

async function deleteProductComponentVersionWithOptions(uid: string, relationUID: string, headers: map[string]string, runtime: Util.RuntimeOptions): DeleteProductComponentVersionResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApi.Params{
    action = 'DeleteProductComponentVersion',
    version = '2021-07-20',
    protocol = 'HTTPS',
    pathname = `/api/v2/product-versions/${OpenApiUtil.getEncodeParam(uid)}/relations/${OpenApiUtil.getEncodeParam(relationUID)}`,
    method = 'DELETE',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteProductComponentVersion(uid: string, relationUID: string): DeleteProductComponentVersionResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return deleteProductComponentVersionWithOptions(uid, relationUID, headers, runtime);
}

model DeleteProductInstanceConfigRequest {
  environmentUID?: string(name='environmentUID'),
  productVersionUID?: string(name='productVersionUID'),
}

model DeleteProductInstanceConfigResponseBody = {
  code?: string(name='code'),
  msg?: string(name='msg'),
}

model DeleteProductInstanceConfigResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteProductInstanceConfigResponseBody(name='body'),
}

async function deleteProductInstanceConfigWithOptions(configUID: string, request: DeleteProductInstanceConfigRequest, headers: map[string]string, runtime: Util.RuntimeOptions): DeleteProductInstanceConfigResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.environmentUID)) {
    query['environmentUID'] = request.environmentUID;
  }
  if (!Util.isUnset(request.productVersionUID)) {
    query['productVersionUID'] = request.productVersionUID;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteProductInstanceConfig',
    version = '2021-07-20',
    protocol = 'HTTPS',
    pathname = `/api/v2/product-instances/configs/${OpenApiUtil.getEncodeParam(configUID)}`,
    method = 'DELETE',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteProductInstanceConfig(configUID: string, request: DeleteProductInstanceConfigRequest): DeleteProductInstanceConfigResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return deleteProductInstanceConfigWithOptions(configUID, request, headers, runtime);
}

model DeleteProductVersionResponseBody = {
  code?: string(name='code', example='Success'),
  msg?: string(name='msg', example='Success'),
  requestId?: string(name='requestId', example='7CADF6FD-0A4A-5BC5-8C89-xxxxxxxxxxxx'),
}

model DeleteProductVersionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteProductVersionResponseBody(name='body'),
}

async function deleteProductVersionWithOptions(uid: string, headers: map[string]string, runtime: Util.RuntimeOptions): DeleteProductVersionResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApi.Params{
    action = 'DeleteProductVersion',
    version = '2021-07-20',
    protocol = 'HTTPS',
    pathname = `/api/v2/product-versions/${OpenApiUtil.getEncodeParam(uid)}`,
    method = 'DELETE',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteProductVersion(uid: string): DeleteProductVersionResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return deleteProductVersionWithOptions(uid, headers, runtime);
}

model DeleteProductVersionConfigResponseBody = {
  code?: string(name='code', example='Success'),
  msg?: string(name='msg', example='Success'),
  requestId?: string(name='requestId', example='C2B58140-529E-5335-B998-xxxxxxxxxxxx'),
}

model DeleteProductVersionConfigResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteProductVersionConfigResponseBody(name='body'),
}

async function deleteProductVersionConfigWithOptions(uid: string, configUID: string, headers: map[string]string, runtime: Util.RuntimeOptions): DeleteProductVersionConfigResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApi.Params{
    action = 'DeleteProductVersionConfig',
    version = '2021-07-20',
    protocol = 'HTTPS',
    pathname = `/api/v2/product-versions/${OpenApiUtil.getEncodeParam(uid)}/configs/${OpenApiUtil.getEncodeParam(configUID)}`,
    method = 'DELETE',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteProductVersionConfig(uid: string, configUID: string): DeleteProductVersionConfigResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return deleteProductVersionConfigWithOptions(uid, configUID, headers, runtime);
}

model GenerateProductInstanceDeploymentConfigRequest {
  environmentUID?: string(name='environmentUID', example='eda83f48-8c50-4e74-a307-xxx'),
  packageContentType?: string(name='packageContentType'),
  packageUID?: string(name='packageUID', example='94f632a9-1990-4c9b-8fd8-xxx'),
  productVersionUID?: string(name='productVersionUID', example='125c24a0-1b5c-42bd-b043-xxx'),
  productVersionUIDList?: [ string ](name='productVersionUIDList'),
}

model GenerateProductInstanceDeploymentConfigResponseBody = {
  code?: string(name='code', example='Success'),
  data?: {
    packageConfig?: string(name='packageConfig', example='clusterId: 21349919-530c-41bb-a0a9-xxx
cluster: {}
global: {}
system: {}
operator:
  cert: |
    -----BEGIN PUBLIC KEY-----
    MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDGpjGRy6YIEjbQHTZ/QHe9TQ9O
    cHDp6nvRLPjqycypVhnIB9RAUEo1n+Ts99OiNef9eNw4EUmBIX2bRNwFy4ZWxSh1
    ekA/6VKXx82sMTEFjHTDtm5gjxn5TnoBcpgoChOPu7VLpPCRO6Xr/MW7/rQ/0gWg
    eknTMLE0JzTXXXXXXX
    -----END PUBLIC KEY-----'),
  }(name='data'),
  msg?: string(name='msg', example='Success'),
}

model GenerateProductInstanceDeploymentConfigResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GenerateProductInstanceDeploymentConfigResponseBody(name='body'),
}

async function generateProductInstanceDeploymentConfigWithOptions(request: GenerateProductInstanceDeploymentConfigRequest, headers: map[string]string, runtime: Util.RuntimeOptions): GenerateProductInstanceDeploymentConfigResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.environmentUID)) {
    body['environmentUID'] = request.environmentUID;
  }
  if (!Util.isUnset(request.packageContentType)) {
    body['packageContentType'] = request.packageContentType;
  }
  if (!Util.isUnset(request.packageUID)) {
    body['packageUID'] = request.packageUID;
  }
  if (!Util.isUnset(request.productVersionUID)) {
    body['productVersionUID'] = request.productVersionUID;
  }
  if (!Util.isUnset(request.productVersionUIDList)) {
    body['productVersionUIDList'] = request.productVersionUIDList;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'GenerateProductInstanceDeploymentConfig',
    version = '2021-07-20',
    protocol = 'HTTPS',
    pathname = `/api/v2/product-instances/package-configs`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function generateProductInstanceDeploymentConfig(request: GenerateProductInstanceDeploymentConfigRequest): GenerateProductInstanceDeploymentConfigResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return generateProductInstanceDeploymentConfigWithOptions(request, headers, runtime);
}

model GetComponentResponseBody = {
  code?: string(name='code', example='Success'),
  data?: {
    category?: string(name='category', example='SAAS'),
    description?: string(name='description'),
    documents?: string(name='documents'),
    name?: string(name='name', example='component-name'),
    public?: boolean(name='public', example='false'),
    singleton?: boolean(name='singleton', example='false'),
    source?: string(name='source', example='aliyun-inc.com'),
    uid?: string(name='uid', example='62cd4869-71b4-4c9f-b6c4-xxxxxxxxxxxx'),
  }(name='data'),
  msg?: string(name='msg', example='Success'),
}

model GetComponentResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetComponentResponseBody(name='body'),
}

async function getComponentWithOptions(uid: string, headers: map[string]string, runtime: Util.RuntimeOptions): GetComponentResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApi.Params{
    action = 'GetComponent',
    version = '2021-07-20',
    protocol = 'HTTPS',
    pathname = `/api/v2/components/${OpenApiUtil.getEncodeParam(uid)}`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getComponent(uid: string): GetComponentResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getComponentWithOptions(uid, headers, runtime);
}

model GetComponentVersionRequest {
  withoutChartContent?: boolean(name='withoutChartContent'),
}

model GetComponentVersionResponseBody = {
  code?: string(name='code'),
  data?: [ 
    {
      componentName?: string(name='componentName'),
      componentUID?: string(name='componentUID'),
      description?: string(name='description'),
      documents?: string(name='documents'),
      orchestrationValues?: string(name='orchestrationValues'),
      packageURL?: string(name='packageURL'),
      parentComponent?: boolean(name='parentComponent'),
      productComponentVersionUID?: string(name='productComponentVersionUID'),
      provider?: string(name='provider'),
      readme?: string(name='readme'),
      resources?: {
        limits?: map[string]any(name='limits'),
        requests?: map[string]any(name='requests'),
      }(name='resources'),
      uid?: string(name='uid'),
      version?: string(name='version'),
    }
  ](name='data'),
  msg?: string(name='msg'),
}

model GetComponentVersionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetComponentVersionResponseBody(name='body'),
}

async function getComponentVersionWithOptions(uid: string, versionUID: string, request: GetComponentVersionRequest, headers: map[string]string, runtime: Util.RuntimeOptions): GetComponentVersionResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.withoutChartContent)) {
    query['withoutChartContent'] = request.withoutChartContent;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetComponentVersion',
    version = '2021-07-20',
    protocol = 'HTTPS',
    pathname = `/integration/api/v2/components/${OpenApiUtil.getEncodeParam(uid)}/versions/${OpenApiUtil.getEncodeParam(versionUID)}`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getComponentVersion(uid: string, versionUID: string, request: GetComponentVersionRequest): GetComponentVersionResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getComponentVersionWithOptions(uid, versionUID, request, headers, runtime);
}

model GetDeliverableResponseBody = {
  code?: string(name='code', example='Success'),
  data?: {
    foundation?: {
      clusterConfig?: string(name='clusterConfig'),
      foundationReferenceUID?: string(name='foundationReferenceUID', example='d4b3b7a4-53cc-4a8e-b500-f6ade9509eb1'),
      foundationVersion?: string(name='foundationVersion', example='1.4.2'),
      foundationVersionUID?: string(name='foundationVersionUID', example='b1a4f675-7c2c-4b98-a480-73d272ec4a9b'),
    }(name='foundation'),
    products?: [ 
      {
        namespace?: string(name='namespace'),
        productName?: string(name='productName', example='tsjdth-805'),
        productType?: string(name='productType', example='own'),
        productUID?: string(name='productUID', example='a203271c-a95a-490d-9a8d-7e7d162e6295'),
        productVersion?: string(name='productVersion', example='1.0.5'),
        productVersionSpecName?: string(name='productVersionSpecName'),
        productVersionSpecUID?: string(name='productVersionSpecUID', example='1a535a2e-6ec6-40aa-7774-0a1342311bf21'),
        productVersionUID?: string(name='productVersionUID', example='0d43562e-3eb5-408a-9974-0a134811bf21'),
      }
    ](name='products'),
    uid?: string(name='uid', example='deliver-2pAoq2DqKvY8'),
  }(name='data'),
  msg?: string(name='msg', example='succeed in handling request'),
}

model GetDeliverableResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetDeliverableResponseBody(name='body'),
}

async function getDeliverableWithOptions(uid: string, headers: map[string]string, runtime: Util.RuntimeOptions): GetDeliverableResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApi.Params{
    action = 'GetDeliverable',
    version = '2021-07-20',
    protocol = 'HTTPS',
    pathname = `/api/v2/delivery/deliverables/${OpenApiUtil.getEncodeParam(uid)}`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getDeliverable(uid: string): GetDeliverableResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getDeliverableWithOptions(uid, headers, runtime);
}

model GetDeliveryPackageResponseBody = {
  code?: string(name='code', example='Success'),
  data?: {
    deliverableUID?: string(name='deliverableUID', example='deliver-glXKBVYg8qBL'),
    originDeliverableUID?: string(name='originDeliverableUID', example='deliver-ovAgJx80B9ZV'),
    packageContentType?: string(name='packageContentType', example='all'),
    packageSize?: string(name='packageSize', example='3.97GB'),
    packageStatus?: string(name='packageStatus', example='Success'),
    packageType?: string(name='packageType', example='full'),
    packageUID?: string(name='packageUID', example='1c33e7b7-2df8-4632-9f94-e1d98caa410d'),
    packageURL?: string(name='packageURL', example='https://cn-shanghai-cnx-packages.oss-cn-shanghai.aliyuncs.com/products/xxxxxxxxxxxxxxxxxx'),
    platform?: string(name='platform', example='linux/amd64'),
  }(name='data'),
  msg?: string(name='msg', example='succeed in handling request'),
}

model GetDeliveryPackageResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetDeliveryPackageResponseBody(name='body'),
}

async function getDeliveryPackageWithOptions(uid: string, headers: map[string]string, runtime: Util.RuntimeOptions): GetDeliveryPackageResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApi.Params{
    action = 'GetDeliveryPackage',
    version = '2021-07-20',
    protocol = 'HTTPS',
    pathname = `/api/v2/delivery/delivery-packages/${OpenApiUtil.getEncodeParam(uid)}`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getDeliveryPackage(uid: string): GetDeliveryPackageResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getDeliveryPackageWithOptions(uid, headers, runtime);
}

model GetEnvironmentRequest {
  options?: {
    withSiteSurveyReport?: boolean(name='withSiteSurveyReport'),
  }(name='options'),
}

model GetEnvironmentShrinkRequest {
  optionsShrink?: string(name='options'),
}

model GetEnvironmentResponseBody = {
  code?: string(name='code', example='Success'),
  data?: {
    advancedConfigs?: {
      enableDeploySimulation?: boolean(name='enableDeploySimulation'),
      enableSiteSurvey?: boolean(name='enableSiteSurvey'),
    }(name='advancedConfigs'),
    clusterId?: string(name='clusterId', example='Deprecated'),
    clusterUID?: string(name='clusterUID'),
    createdAt?: string(name='createdAt', example='2022-05-11T00:00:00+08:00'),
    description?: string(name='description'),
    expiredAt?: string(name='expiredAt'),
    foundationType?: string(name='foundationType'),
    foundationVersion?: string(name='foundationVersion', example='v1.4.3'),
    foundationVersionUID?: string(name='foundationVersionUID', example='484c4a1e-69c7-4395-8e02-xxx'),
    instanceList?: [
      InstanceInfo
    ](name='instanceList'),
    instanceStatus?: string(name='instanceStatus', example='INITING'),
    location?: string(name='location'),
    name?: string(name='name', example='env-demo'),
    oldProductVersion?: string(name='oldProductVersion', example='v1.0.0'),
    oldProductVersionUID?: string(name='oldProductVersionUID', example='79afa0dc-8557-4cff-aec7-xxx'),
    platform?: {
      architecture?: string(name='architecture', example='amd64'),
      os?: string(name='os', example='linux'),
    }(name='platform'),
    platformList?: [
      Platform
    ](name='platformList'),
    platformStatus?: string(name='platformStatus', example='INIT'),
    productName?: string(name='productName', example='demo-product'),
    productVersion?: string(name='productVersion', example='v1.0.2'),
    siteSurveyReport?: {
      checkList?: [ 
        {
          description?: map[string]any(name='description'),
          failedList?: [ 
            {
              ip?: string(name='ip'),
              reason?: map[string]any(name='reason'),
            }
          ](name='failedList'),
          level?: string(name='level'),
          name?: string(name='name'),
          status?: string(name='status'),
        }
      ](name='checkList'),
      result?: string(name='result'),
    }(name='siteSurveyReport'),
    uid?: string(name='uid', example='b8ec63af-7859-4464-9cff-xxx'),
    vendorConfig?: string(name='vendorConfig'),
    vendorType?: string(name='vendorType', example='alicloud'),
  }(name='data'),
  msg?: string(name='msg', example='Success'),
}

model GetEnvironmentResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetEnvironmentResponseBody(name='body'),
}

async function getEnvironmentWithOptions(uid: string, tmpReq: GetEnvironmentRequest, headers: map[string]string, runtime: Util.RuntimeOptions): GetEnvironmentResponse {
  Util.validateModel(tmpReq);
  var request = new GetEnvironmentShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.options)) {
    request.optionsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.options, 'options', 'json');
  }
  var query : map[string]any = {};
  if (!Util.isUnset(request.optionsShrink)) {
    query['options'] = request.optionsShrink;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetEnvironment',
    version = '2021-07-20',
    protocol = 'HTTPS',
    pathname = `/api/v2/environments/${OpenApiUtil.getEncodeParam(uid)}`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getEnvironment(uid: string, request: GetEnvironmentRequest): GetEnvironmentResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getEnvironmentWithOptions(uid, request, headers, runtime);
}

model GetEnvironmentDeliveryInstanceRequest {
  clusterUID?: string(name='clusterUID', example='45e95854-0562-4678-a526-93106a24df1b'),
  envUID?: string(name='envUID', example='c1bb74cb-c549-4b70-8f92-187b3015d309'),
}

model GetEnvironmentDeliveryInstanceResponseBody = {
  code?: string(name='code', example='Success'),
  data?: {
    clusterUID?: string(name='clusterUID', example='4a66131e-23da-423a-8c9a-c77ee9373013'),
    deliverableConfigUID?: string(name='deliverableConfigUID', example='deliver-cfg-x24xj0yDB4X9'),
    deliverableUID?: string(name='deliverableUID', example='deliver-glXKBVYg8qBL'),
    envUID?: string(name='envUID', example='150ed1ae-eacd-4b9c-80d8-512c569b662a'),
    uid?: string(name='uid', example='f1a5956b-662f-4621-a1ae-45313b7b00e7'),
  }(name='data'),
  msg?: string(name='msg', example='succeed in handling request'),
}

model GetEnvironmentDeliveryInstanceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetEnvironmentDeliveryInstanceResponseBody(name='body'),
}

async function getEnvironmentDeliveryInstanceWithOptions(request: GetEnvironmentDeliveryInstanceRequest, headers: map[string]string, runtime: Util.RuntimeOptions): GetEnvironmentDeliveryInstanceResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.clusterUID)) {
    query['clusterUID'] = request.clusterUID;
  }
  if (!Util.isUnset(request.envUID)) {
    query['envUID'] = request.envUID;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetEnvironmentDeliveryInstance',
    version = '2021-07-20',
    protocol = 'HTTPS',
    pathname = `/api/v2/delivery/delivery-instances`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getEnvironmentDeliveryInstance(request: GetEnvironmentDeliveryInstanceRequest): GetEnvironmentDeliveryInstanceResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getEnvironmentDeliveryInstanceWithOptions(request, headers, runtime);
}

model GetEnvironmentLicenseRequest {
  options?: {
    withSecretYAML?: boolean(name='withSecretYAML', example='false'),
  }(name='options'),
}

model GetEnvironmentLicenseShrinkRequest {
  optionsShrink?: string(name='options'),
}

model GetEnvironmentLicenseResponseBody = {
  code?: string(name='code', example='Success'),
  data?: {
    expireTime?: string(name='expireTime', example='2122-05-10T19:42:15+08:00'),
    licenseKey?: string(name='licenseKey', example='sKSQqgNrIhSL46z44zmNdCTfswaz5qM4inMHUMuCOtnIif4sNaor5U57iuDgrQLDNowllLht1gscn9/5jvhLbaPX5/BsdIqcTG2CVsQdu1g9Jhntw70h3upoWJFzEEo/+hOLRjjGPxWAiDwCflscDlL6JhMJq4tI7Uh/tPx8X7xtIyvH09DJdONfh54hznJrofmLyvrmkqt8VaM5ZPXsLDhetoYcXVCjc4fgSF3t3m+LCFevZKiIjwYc0TMirHZACjU2L0o3ovPzT5crpRafHV3B5GhBPuTlEZ7azdRs2tOKPj/56mPA1mv9easgheGcibeblo+Fnwf/S5CcADfzAwkKCO/57joJu6Wwwnw+VtRcbi2+Eiw7/wohBze8nS6G9J/arjJdmiOyQQ1FTY47mB71x05aFg+ZiLosfZigHG0XgTFx1Is63l6cpfECdCkRh5CwdtOi4Eceto3svcJO1dddBAtcPsYCbtqw8Los38KILlXSVVEgHAhBqHxudAHnZ27CX/z5tizLg6+jNEVpyRJCA1Vm+zAzVJ62xxxxxxxx='),
    licenseQuota?: {
      clusterQuota?: {
        cpuCoreLimit?: long(name='cpuCoreLimit', example='100'),
      }(name='clusterQuota'),
      componentQuotas?: [ 
        {
          componentName?: string(name='componentName', example='adp-test'),
          componentSource?: string(name='componentSource', example='aliyun-inc'),
          instanceLimit?: long(name='instanceLimit', example='1'),
        }
      ](name='componentQuotas'),
      customQuotas?: [ 
        {
          description?: string(name='description', example='value of name'),
          key?: string(name='key', example='name'),
          value?: string(name='value', example='aliyun'),
        }
      ](name='customQuotas'),
    }(name='licenseQuota'),
    productVersionUID?: string(name='productVersionUID', example='e61f944c-c021-46bd-a877-xxxxxxxxxxxx'),
    rejectReason?: string(name='rejectReason'),
    scope?: string(name='scope', example='foundation'),
    secretYAML?: string(name='secretYAML', description='kubernetes secret yaml。', example='apiVersion: v1\\ndata:\\n  license: xxxxxXFnTnJJaFNMNDZ6NDR6bU5kQ1Rmc3dhejVxTTRpbk1IVU11Q090bklpZjRzTmFvcjVVNTdpdURnclFMRE5vd2xsTGh0MWdzY245LzVqdmhMYmFQWDUvQnNkSXFjVEcyQ1ZzUWR1MWc5SmhudHc3MGgzdXBvV0pGekVFby8raE9MUmpqR1B4V0FpRHdDZmxzY0RsTDZKaE1KcTR0STdVaC90UHg4WDd4dEl5dkgwOURKZE9OZmg1NGh6bkpyb2ZtTHl2cm1rcXQ4VmFNNVpQWHNMRGhldG9ZY1hWQ2pjNGZnU0YzdDNtK0xDRmV2WktpSWp3WWMwVE1pckhaQUNqVTJMMG8zb3ZQelQ1Y3JwUmFmSFYzQjVHaEJQdVRsRVo3YXpkUnMydE9LUGovNTZtUEExbXY5ZWFzZ2hlR2NpYmVibG8rRm53Zi9TNUNjQURmekF3a0tDTy81N2pvSnU2V3d3bncrVnRSY2JpMitFaXc3L3dvaEJ6ZThuUzZHOUovYXJqSmRtaU95UVExRlRZNDdtQjcxeDA1YUZnK1ppTG9zZlppZ0hHMFhnVEZ4MUlzNjNsNmNwZkVDZENrUmg1Q3dkdE9pNEVjZXRvM3N2Y0pPMWRkZEJBdGNQc1lDYnRxdzhMb3MzOEtJTGxYU1ZWRWdIQWhCcUh4dWRBSG5aMjdDWC96NXRpekxnNitqTkVWcHlSSkNBMVZtK3pBelZKNjJHc3ZJcTVzPQ==\\nkind: Secret\\nmetadata:\\n  creationTimestamp: null\\n  labels:\\n    adp.aliyuncs.com/application-name: adp\\n    adp.aliyuncs.com/license: \\"true\\"\\n  name: license-adp\\ntype: Opaque\\n'),
    status?: string(name='status', example='approved'),
    type?: string(name='type', example='OnTrial'),
    uid?: string(name='uid', example='3c35c6fa-c080-444b-89ac-xxxxxxxxxxxx'),
  }(name='data'),
  msg?: string(name='msg', example='Success'),
}

model GetEnvironmentLicenseResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetEnvironmentLicenseResponseBody(name='body'),
}

async function getEnvironmentLicenseWithOptions(uid: string, licenseUID: string, tmpReq: GetEnvironmentLicenseRequest, headers: map[string]string, runtime: Util.RuntimeOptions): GetEnvironmentLicenseResponse {
  Util.validateModel(tmpReq);
  var request = new GetEnvironmentLicenseShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.options)) {
    request.optionsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.options, 'options', 'json');
  }
  var query : map[string]any = {};
  if (!Util.isUnset(request.optionsShrink)) {
    query['options'] = request.optionsShrink;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetEnvironmentLicense',
    version = '2021-07-20',
    protocol = 'HTTPS',
    pathname = `/api/v2/environments/${OpenApiUtil.getEncodeParam(uid)}/licenses/${OpenApiUtil.getEncodeParam(licenseUID)}`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getEnvironmentLicense(uid: string, licenseUID: string, request: GetEnvironmentLicenseRequest): GetEnvironmentLicenseResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getEnvironmentLicenseWithOptions(uid, licenseUID, request, headers, runtime);
}

model GetEnvironmentNodeResponseBody = {
  code?: string(name='code', example='Success'),
  data?: InstanceInfo(name='data'),
  msg?: string(name='msg', example='Success'),
}

model GetEnvironmentNodeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetEnvironmentNodeResponseBody(name='body'),
}

async function getEnvironmentNodeWithOptions(uid: string, nodeUID: string, headers: map[string]string, runtime: Util.RuntimeOptions): GetEnvironmentNodeResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApi.Params{
    action = 'GetEnvironmentNode',
    version = '2021-07-20',
    protocol = 'HTTPS',
    pathname = `/api/v2/environments/${OpenApiUtil.getEncodeParam(uid)}/nodes/${OpenApiUtil.getEncodeParam(nodeUID)}`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getEnvironmentNode(uid: string, nodeUID: string): GetEnvironmentNodeResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getEnvironmentNodeWithOptions(uid, nodeUID, headers, runtime);
}

model GetFoundationComponentReferenceResponseBody = {
  code?: string(name='code', example='Success'),
  data?: {
    list?: [
      FoundationComponentReferenceDetail
    ](name='list'),
  }(name='data'),
  msg?: string(name='msg', example='Success'),
}

model GetFoundationComponentReferenceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetFoundationComponentReferenceResponseBody(name='body'),
}

async function getFoundationComponentReferenceWithOptions(componentReferenceUID: string, uid: string, headers: map[string]string, runtime: Util.RuntimeOptions): GetFoundationComponentReferenceResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApi.Params{
    action = 'GetFoundationComponentReference',
    version = '2021-07-20',
    protocol = 'HTTPS',
    pathname = `/api/v2/foundation-references/${OpenApiUtil.getEncodeParam(uid)}/components/${OpenApiUtil.getEncodeParam(componentReferenceUID)}`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getFoundationComponentReference(componentReferenceUID: string, uid: string): GetFoundationComponentReferenceResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getFoundationComponentReferenceWithOptions(componentReferenceUID, uid, headers, runtime);
}

model GetFoundationReferenceResponseBody = {
  code?: string(name='code', example='Success'),
  data?: {
    clusterConfig?: string(name='clusterConfig'),
    foundationVersionUID?: string(name='foundationVersionUID', example='b1b528a6-8341-4f06-89af-xxx'),
    uid?: string(name='uid', example='d26ddfad-fa97-4a2b-9433-xxx'),
  }(name='data'),
  msg?: string(name='msg', example='Success'),
}

model GetFoundationReferenceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetFoundationReferenceResponseBody(name='body'),
}

async function getFoundationReferenceWithOptions(uid: string, headers: map[string]string, runtime: Util.RuntimeOptions): GetFoundationReferenceResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApi.Params{
    action = 'GetFoundationReference',
    version = '2021-07-20',
    protocol = 'HTTPS',
    pathname = `/api/v2/foundation-references/${OpenApiUtil.getEncodeParam(uid)}/info`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getFoundationReference(uid: string): GetFoundationReferenceResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getFoundationReferenceWithOptions(uid, headers, runtime);
}

model GetFoundationVersionResponseBody = {
  code?: string(name='code', example='Success'),
  data?: {
    description?: string(name='description'),
    features?: [ string ](name='features'),
    isDefault?: boolean(name='isDefault'),
    labels?: string(name='labels', example='{}'),
    name?: string(name='name', example='ADP 底座'),
    platforms?: [
      Platform
    ](name='platforms'),
    siteSurveyTool?: {
      clusterCheckerURL?: string(name='clusterCheckerURL'),
      clusterInfoBrief?: string(name='clusterInfoBrief'),
    }(name='siteSurveyTool'),
    specName?: string(name='specName'),
    status?: string(name='status', example='Published'),
    type?: string(name='type', example='trident'),
    uid?: string(name='uid', example='4686a7d7-04b4-4101-9466-xxx'),
    version?: string(name='version', description='version', example='v1.4.3'),
  }(name='data'),
  msg?: string(name='msg', example='Success'),
}

model GetFoundationVersionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetFoundationVersionResponseBody(name='body'),
}

async function getFoundationVersionWithOptions(uid: string, headers: map[string]string, runtime: Util.RuntimeOptions): GetFoundationVersionResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApi.Params{
    action = 'GetFoundationVersion',
    version = '2021-07-20',
    protocol = 'HTTPS',
    pathname = `/api/v2/foundation/versions/${OpenApiUtil.getEncodeParam(uid)}`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getFoundationVersion(uid: string): GetFoundationVersionResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getFoundationVersionWithOptions(uid, headers, runtime);
}

model GetProductRequest {
  withIconURL?: boolean(name='withIconURL'),
}

model GetProductResponseBody = {
  code?: string(name='code', example='Success'),
  data?: {
    categories?: [ string ](name='categories'),
    description?: string(name='description'),
    displayName?: string(name='displayName'),
    icons?: [ 
      {
        description?: string(name='description'),
        name?: string(name='name'),
        url?: string(name='url'),
      }
    ](name='icons'),
    name?: string(name='name', example='test-product'),
    uid?: string(name='uid', example='54ccb2c9-3205-4159-8c44-xxxxxxxxxxxx'),
    vendor?: string(name='vendor'),
  }(name='data'),
  msg?: string(name='msg', example='Success'),
}

model GetProductResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetProductResponseBody(name='body'),
}

async function getProductWithOptions(uid: string, request: GetProductRequest, headers: map[string]string, runtime: Util.RuntimeOptions): GetProductResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.withIconURL)) {
    query['withIconURL'] = request.withIconURL;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetProduct',
    version = '2021-07-20',
    protocol = 'HTTPS',
    pathname = `/api/v2/products/${OpenApiUtil.getEncodeParam(uid)}`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getProduct(uid: string, request: GetProductRequest): GetProductResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getProductWithOptions(uid, request, headers, runtime);
}

model GetProductComponentVersionResponseBody = {
  code?: string(name='code', example='Success'),
  data?: [ 
    {
      appVersion?: string(name='appVersion', example='1.0.0'),
      category?: string(name='category'),
      componentDescription?: string(name='componentDescription'),
      componentName?: string(name='componentName', example='component-name'),
      componentUID?: string(name='componentUID', example='62cd4869-71b4-4c9f-b6c4-xxxxxxxxxxxx'),
      componentVersionDescription?: string(name='componentVersionDescription'),
      componentVersionUID?: string(name='componentVersionUID', example='9963a9ec-95d0-4e82-88c8-xxxxxxxxxxxx'),
      enable?: boolean(name='enable', example='true'),
      namespace?: string(name='namespace', example='default'),
      orchestrationValues?: string(name='orchestrationValues', example='replicaCount: 2\\n\\nresources:\\n  limits:\\n    cpu: 200m\\n    memory: 512Mi\\n  requests:\\n    cpu: 100m\\n    memory: 256Mi'),
      parentComponent?: boolean(name='parentComponent', example='false'),
      parentComponentVersionRelationUID?: string(name='parentComponentVersionRelationUID', example='7a5685f0-35f0--478c-8869-xxxxxxxxxxxx'),
      parentComponentVersionUID?: string(name='parentComponentVersionUID', example='944ce61f-10c1-46bd-a877-xxxxxxxxxxxx'),
      productVersionUID?: string(name='productVersionUID', example='e61f944c-c021-46bd-a877-xxxxxxxxxxxx'),
      relationUID?: string(name='relationUID', example='85f035f0-7a56-478c-8869-xxxxxxxxxxxx'),
      releaseName?: string(name='releaseName', example='component-release'),
      resources?: string(name='resources'),
      sequence?: int32(name='sequence'),
      source?: string(name='source'),
      values?: string(name='values', example='replicaCount: 2\\n\\nresources:\\n  limits:\\n    cpu: 200m\\n    memory: 512Mi\\n  requests:\\n    cpu: 100m\\n    memory: 256Mi'),
      version?: string(name='version', example='1.0.0'),
    }
  ](name='data'),
  msg?: string(name='msg', example='Success'),
}

model GetProductComponentVersionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetProductComponentVersionResponseBody(name='body'),
}

async function getProductComponentVersionWithOptions(relationUID: string, uid: string, headers: map[string]string, runtime: Util.RuntimeOptions): GetProductComponentVersionResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApi.Params{
    action = 'GetProductComponentVersion',
    version = '2021-07-20',
    protocol = 'HTTPS',
    pathname = `/integration/api/v2/product-versions/${OpenApiUtil.getEncodeParam(uid)}/relations/${OpenApiUtil.getEncodeParam(relationUID)}`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getProductComponentVersion(relationUID: string, uid: string): GetProductComponentVersionResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getProductComponentVersionWithOptions(relationUID, uid, headers, runtime);
}

model GetProductDeploymentRequest {
  environmentUID?: string(name='environmentUID', example='b8ec63af-7859-4464-9cff-xxx'),
  productVersionUID?: string(name='productVersionUID', example='de08f185-b117-4ff5-9335-xxx'),
  withParamConfig?: boolean(name='withParamConfig', example='false'),
}

model GetProductDeploymentResponseBody = {
  code?: string(name='code', example='Success'),
  data?: {
    envParams?: string(name='envParams', example='clusterId: db53384e-6ed2-4902-ad38-xxx
cluster: {}
nodes: []
global: {}
system:
  CLUSTER_MASTER0_PUB_IP: xxx.xxx.xxx.xxx
operator:
  cert: |
    -----BEGIN PUBLIC KEY-----
    MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDEU9lG21mFMo+E1Iq72arIxVV1
    7wDfmeS+mrGC748XcxxxxAQh16Y8Cf4qTW8G1Azj3dMED6043VNzfg7b7Mn
    sEZ6tunK7FJFw3wdF/15g6zZs4LRBGlxNmpWm/l1cl5y2bjwV68IWWYLLF2EhOcs
    R28x8ZA6UOPyL13vXXXX
    -----END PUBLIC KEY-----'),
    envUID?: string(name='envUID', example='b8ec63af-7859-4464-9cff-xxx'),
    status?: string(name='status', example='Success'),
    uid?: string(name='uid', example='5699b683-075a-4c51-a78c-xxx'),
  }(name='data'),
  msg?: string(name='msg', example='Success'),
}

model GetProductDeploymentResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetProductDeploymentResponseBody(name='body'),
}

async function getProductDeploymentWithOptions(deploymentUID: string, request: GetProductDeploymentRequest, headers: map[string]string, runtime: Util.RuntimeOptions): GetProductDeploymentResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.environmentUID)) {
    query['environmentUID'] = request.environmentUID;
  }
  if (!Util.isUnset(request.productVersionUID)) {
    query['productVersionUID'] = request.productVersionUID;
  }
  if (!Util.isUnset(request.withParamConfig)) {
    query['withParamConfig'] = request.withParamConfig;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetProductDeployment',
    version = '2021-07-20',
    protocol = 'HTTPS',
    pathname = `/api/v2/product-instances/deployments/${OpenApiUtil.getEncodeParam(deploymentUID)}`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getProductDeployment(deploymentUID: string, request: GetProductDeploymentRequest): GetProductDeploymentResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getProductDeploymentWithOptions(deploymentUID, request, headers, runtime);
}

model GetProductVersionRequest {
  withDocumentationURL?: boolean(name='withDocumentationURL'),
  withExtendResourceURL?: boolean(name='withExtendResourceURL'),
}

model GetProductVersionResponseBody = {
  code?: string(name='code', example='Success。'),
  data?: {
    continuousIntegration?: boolean(name='continuousIntegration'),
    description?: string(name='description'),
    documentations?: [ 
      {
        description?: string(name='description'),
        name?: string(name='name'),
        url?: string(name='url'),
      }
    ](name='documentations'),
    extendedResources?: [ 
      {
        description?: string(name='description'),
        name?: string(name='name'),
        url?: string(name='url'),
      }
    ](name='extendedResources'),
    foundationVersionUID?: string(name='foundationVersionUID'),
    packageURL?: string(name='packageURL'),
    platforms?: [
      Platform
    ](name='platforms'),
    productName?: string(name='productName', example='test-product'),
    productUID?: string(name='productUID', example='54ccb2c9-3205-4159-8c44-xxxxxxxxxxxx'),
    provider?: string(name='provider'),
    timeout?: long(name='timeout'),
    uid?: string(name='uid', example='e61f944c-c021-46bd-a877-xxxxxxxxxxxx'),
    version?: string(name='version', example='1.0.0'),
  }(name='data'),
  msg?: string(name='msg', example='Success。'),
}

model GetProductVersionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetProductVersionResponseBody(name='body'),
}

async function getProductVersionWithOptions(uid: string, request: GetProductVersionRequest, headers: map[string]string, runtime: Util.RuntimeOptions): GetProductVersionResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.withDocumentationURL)) {
    query['withDocumentationURL'] = request.withDocumentationURL;
  }
  if (!Util.isUnset(request.withExtendResourceURL)) {
    query['withExtendResourceURL'] = request.withExtendResourceURL;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetProductVersion',
    version = '2021-07-20',
    protocol = 'HTTPS',
    pathname = `/api/v2/product-versions/${OpenApiUtil.getEncodeParam(uid)}`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getProductVersion(uid: string, request: GetProductVersionRequest): GetProductVersionResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getProductVersionWithOptions(uid, request, headers, runtime);
}

model GetProductVersionDifferencesRequest {
  preVersionUID?: string(name='preVersionUID'),
}

model GetProductVersionDifferencesResponseBody = {
  code?: string(name='code'),
  data?: [ 
    {
      componentName?: string(name='componentName'),
      difference?: string(name='difference', example='Create/Delete/VersionUpdate/ConfigUpdate/NoChanged'),
      message?: string(name='message'),
      preVersion?: string(name='preVersion'),
      releaseName?: string(name='releaseName'),
      upgradeFlag?: boolean(name='upgradeFlag'),
      version?: string(name='version'),
    }
  ](name='data'),
  msg?: string(name='msg'),
  requestId?: string(name='requestId'),
}

model GetProductVersionDifferencesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetProductVersionDifferencesResponseBody(name='body'),
}

async function getProductVersionDifferencesWithOptions(uid: string, versionUID: string, request: GetProductVersionDifferencesRequest, headers: map[string]string, runtime: Util.RuntimeOptions): GetProductVersionDifferencesResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.preVersionUID)) {
    query['preVersionUID'] = request.preVersionUID;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetProductVersionDifferences',
    version = '2021-07-20',
    protocol = 'HTTPS',
    pathname = `/integration/api/v2/products/${OpenApiUtil.getEncodeParam(uid)}/versions/${OpenApiUtil.getEncodeParam(versionUID)}/differences`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getProductVersionDifferences(uid: string, versionUID: string, request: GetProductVersionDifferencesRequest): GetProductVersionDifferencesResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getProductVersionDifferencesWithOptions(uid, versionUID, request, headers, runtime);
}

model GetProductVersionPackageRequest {
  foundationReferenceUID?: string(name='foundationReferenceUID'),
  oldFoundationReferenceUID?: string(name='oldFoundationReferenceUID'),
  oldProductVersionUID?: string(name='oldProductVersionUID', example='5f1261e4-7462-48d8-8f9d-xxxxxxxxxxxx'),
  packageContentType?: string(name='packageContentType', example='all'),
  packageType?: string(name='packageType', example='full'),
  packageUID?: string(name='packageUID', example='1c33e7b7-2df8-4632-9f94-xxxxxxxxxxxx'),
  platform?: string(name='platform', example='linux/amd64'),
  withURL?: boolean(name='withURL', example='true'),
}

model GetProductVersionPackageResponseBody = {
  code?: string(name='code', example='Success'),
  data?: {
    packageContentType?: string(name='packageContentType', example='all'),
    packageSize?: string(name='packageSize', example='3.97GB'),
    packageStatus?: string(name='packageStatus', example='Success'),
    packageType?: string(name='packageType', example='full'),
    packageUID?: string(name='packageUID', example='1c33e7b7-2df8-4632-9f94-e1d98caa410d'),
    packageURL?: string(name='packageURL', example='https://cn-shanghai-cnx-packages.oss-cn-shanghai.aliyuncs.com/products/xxxxxxxxxxxxxxxxxx'),
    platform?: Platform(name='platform', example='{
  "os":"linux",
  "architecture":"amd64"
}'),
    platformList?: [
      Platform
    ](name='platformList'),
  }(name='data'),
  msg?: string(name='msg', example='Success'),
}

model GetProductVersionPackageResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetProductVersionPackageResponseBody(name='body'),
}

async function getProductVersionPackageWithOptions(uid: string, request: GetProductVersionPackageRequest, headers: map[string]string, runtime: Util.RuntimeOptions): GetProductVersionPackageResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.foundationReferenceUID)) {
    query['foundationReferenceUID'] = request.foundationReferenceUID;
  }
  if (!Util.isUnset(request.oldFoundationReferenceUID)) {
    query['oldFoundationReferenceUID'] = request.oldFoundationReferenceUID;
  }
  if (!Util.isUnset(request.oldProductVersionUID)) {
    query['oldProductVersionUID'] = request.oldProductVersionUID;
  }
  if (!Util.isUnset(request.packageContentType)) {
    query['packageContentType'] = request.packageContentType;
  }
  if (!Util.isUnset(request.packageType)) {
    query['packageType'] = request.packageType;
  }
  if (!Util.isUnset(request.packageUID)) {
    query['packageUID'] = request.packageUID;
  }
  if (!Util.isUnset(request.platform)) {
    query['platform'] = request.platform;
  }
  if (!Util.isUnset(request.withURL)) {
    query['withURL'] = request.withURL;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetProductVersionPackage',
    version = '2021-07-20',
    protocol = 'HTTPS',
    pathname = `/api/v2/hosting/product-versions/${OpenApiUtil.getEncodeParam(uid)}/packages`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getProductVersionPackage(uid: string, request: GetProductVersionPackageRequest): GetProductVersionPackageResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getProductVersionPackageWithOptions(uid, request, headers, runtime);
}

model GetResourceSnapshotRequest {
  productVersionUID?: string(name='productVersionUID'),
  uid?: string(name='uid'),
}

model GetResourceSnapshotResponseBody = {
  CPULimit?: string(name='CPULimit'),
  CPURequest?: string(name='CPURequest'),
  adpInfo?: {
    CPURequest?: string(name='CPURequest'),
    componentNum?: int32(name='componentNum'),
    components?: [ 
      {
        CPULimit?: string(name='CPULimit'),
        CPURequest?: string(name='CPURequest'),
        componentName?: string(name='componentName'),
        componentReleaseName?: string(name='componentReleaseName'),
        componentVersion?: string(name='componentVersion'),
        memoryLimit?: string(name='memoryLimit'),
        memoryRequest?: string(name='memoryRequest'),
        orchestrationValue?: string(name='orchestrationValue'),
        status?: string(name='status'),
        storageRequest?: string(name='storageRequest'),
      }
    ](name='components'),
    memoryRequest?: string(name='memoryRequest'),
    podNum?: int32(name='podNum'),
    storageRequest?: string(name='storageRequest'),
    workloadNum?: int32(name='workloadNum'),
  }(name='adpInfo'),
  memoryLimit?: string(name='memoryLimit'),
  memoryRequest?: string(name='memoryRequest'),
  productInfo?: {
    CPURequest?: string(name='CPURequest'),
    componentNum?: int32(name='componentNum'),
    components?: [ 
      {
        CPULimit?: string(name='CPULimit'),
        CPURequest?: string(name='CPURequest'),
        componentName?: string(name='componentName'),
        componentReleaseName?: string(name='componentReleaseName'),
        componentVersion?: string(name='componentVersion'),
        memoryLimit?: string(name='memoryLimit'),
        memoryRequest?: string(name='memoryRequest'),
        orchestrationValue?: string(name='orchestrationValue'),
        status?: string(name='status'),
        storageRequest?: string(name='storageRequest'),
      }
    ](name='components'),
    memoryRequest?: string(name='memoryRequest'),
    podNum?: int32(name='podNum'),
    storageRequest?: string(name='storageRequest'),
    workloadNum?: int32(name='workloadNum'),
  }(name='productInfo'),
  specParamConfigs?: [ 
    {
      componentName?: string(name='componentName'),
      componentReleaseName?: string(name='componentReleaseName'),
      componentSource?: string(name='componentSource'),
      componentVersion?: string(name='componentVersion'),
      name?: string(name='name'),
      paramType?: string(name='paramType'),
      parentComponentName?: string(name='parentComponentName'),
      parentComponentReleaseName?: string(name='parentComponentReleaseName'),
      parentComponentVersion?: string(name='parentComponentVersion'),
      value?: string(name='value'),
      valueType?: string(name='valueType'),
    }
  ](name='specParamConfigs'),
  storageRequest?: string(name='storageRequest'),
}

model GetResourceSnapshotResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetResourceSnapshotResponseBody(name='body'),
}

async function getResourceSnapshotWithOptions(request: GetResourceSnapshotRequest, headers: map[string]string, runtime: Util.RuntimeOptions): GetResourceSnapshotResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.productVersionUID)) {
    query['productVersionUID'] = request.productVersionUID;
  }
  if (!Util.isUnset(request.uid)) {
    query['uid'] = request.uid;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetResourceSnapshot',
    version = '2021-07-20',
    protocol = 'HTTPS',
    pathname = `/api/v2/resource-snapshots`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getResourceSnapshot(request: GetResourceSnapshotRequest): GetResourceSnapshotResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getResourceSnapshotWithOptions(request, headers, runtime);
}

model GetWorkflowStatusRequest {
  workflowType?: string(name='workflowType'),
  xuid?: string(name='xuid'),
}

model GetWorkflowStatusResponseBody = {
  code?: string(name='code'),
  data?: {
    status?: string(name='status'),
    stepStatus?: [ 
      {
        name?: string(name='name'),
        status?: string(name='status'),
        workflowTasks?: [ 
          {
            name?: string(name='name'),
            status?: string(name='status'),
          }
        ](name='workflowTasks'),
      }
    ](name='stepStatus'),
  }(name='data'),
  msg?: string(name='msg'),
}

model GetWorkflowStatusResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetWorkflowStatusResponseBody(name='body'),
}

async function getWorkflowStatusWithOptions(request: GetWorkflowStatusRequest, headers: map[string]string, runtime: Util.RuntimeOptions): GetWorkflowStatusResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.workflowType)) {
    query['workflowType'] = request.workflowType;
  }
  if (!Util.isUnset(request.xuid)) {
    query['xuid'] = request.xuid;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetWorkflowStatus',
    version = '2021-07-20',
    protocol = 'HTTPS',
    pathname = `/api/v2/workflows/status`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getWorkflowStatus(request: GetWorkflowStatusRequest): GetWorkflowStatusResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getWorkflowStatusWithOptions(request, headers, runtime);
}

model InitEnvironmentResourceRequest {
  accessKeyID?: string(name='accessKeyID'),
  accessKeySecret?: string(name='accessKeySecret'),
  securityToken?: string(name='securityToken'),
}

model InitEnvironmentResourceResponseBody = {
  code?: string(name='code'),
  data?: {
    status?: string(name='status'),
  }(name='data'),
  msg?: string(name='msg'),
}

model InitEnvironmentResourceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: InitEnvironmentResourceResponseBody(name='body'),
}

async function initEnvironmentResourceWithOptions(uid: string, request: InitEnvironmentResourceRequest, headers: map[string]string, runtime: Util.RuntimeOptions): InitEnvironmentResourceResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.accessKeyID)) {
    body['accessKeyID'] = request.accessKeyID;
  }
  if (!Util.isUnset(request.accessKeySecret)) {
    body['accessKeySecret'] = request.accessKeySecret;
  }
  if (!Util.isUnset(request.securityToken)) {
    body['securityToken'] = request.securityToken;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'InitEnvironmentResource',
    version = '2021-07-20',
    protocol = 'HTTPS',
    pathname = `/api/v2/environments/${OpenApiUtil.getEncodeParam(uid)}/resources`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function initEnvironmentResource(uid: string, request: InitEnvironmentResourceRequest): InitEnvironmentResourceResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return initEnvironmentResourceWithOptions(uid, request, headers, runtime);
}

model ListComponentVersionsRequest {
  pageNum?: int32(name='pageNum', example='1'),
  pageSize?: int32(name='pageSize', example='10'),
  platforms?: [ 
    {
      architecture?: string(name='architecture', example='amd64'),
      os?: string(name='os', example='linux'),
    }
  ](name='platforms'),
  version?: string(name='version'),
}

model ListComponentVersionsShrinkRequest {
  pageNum?: int32(name='pageNum', example='1'),
  pageSize?: int32(name='pageSize', example='10'),
  platformsShrink?: string(name='platforms'),
  version?: string(name='version'),
}

model ListComponentVersionsResponseBody = {
  requestId?: string(name='RequestId', example='994FA608-A84E-5DA6-B8E6-xxxxxxxxxxxx'),
  code?: string(name='code', example='Success'),
  data?: {
    list?: [ 
      {
        appVersion?: string(name='appVersion', example='1.0.0'),
        componentName?: string(name='componentName', example='component'),
        componentUID?: string(name='componentUID', example='62cd4869-71b4-4c9f-b6c4-xxxxxxxxxxxx'),
        description?: string(name='description', example='test'),
        documents?: string(name='documents'),
        imagesMapping?: string(name='imagesMapping', example='[{"Registry":"harbor.middleware.com","Repository":"middleware/rocketmq-namesrv","Tag":"4.8.0","ImageID":"sha256:d4a8260cffbd40cc4bd586cbf7cc29d22fb0807e318ec1aca66fb3e82fa7xxxx","ManagedImage":"xxx-registry.cn-shanghai.cr.aliyuncs.com/cloud-middleware/harmonycloud-cn-rocketmq:middleware_rocketmq-namesrv-4.8.0-d4a8260cxxxx"}]'),
        orchestrationValues?: string(name='orchestrationValues', example='replicaCount: 2\\n\\nresources:\\n  limits:\\n    cpu: 200m\\n    memory: 512Mi\\n  requests:\\n    cpu: 100m\\n    memory: 256Mi'),
        packageURL?: string(name='packageURL'),
        parentComponent?: boolean(name='parentComponent', example='false'),
        readme?: string(name='readme', example='readme'),
        resources?: string(name='resources'),
        uid?: string(name='uid', example='8020f041-4a8f-4222-a9d7-aa6b8effb701'),
        version?: string(name='version', example='1.0.0'),
      }
    ](name='list'),
    pageNum?: int32(name='pageNum', example='1'),
    pageSize?: int32(name='pageSize', example='10'),
    total?: int32(name='total', example='100'),
  }(name='data'),
  msg?: string(name='msg', example='Success'),
}

model ListComponentVersionsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListComponentVersionsResponseBody(name='body'),
}

async function listComponentVersionsWithOptions(uid: string, tmpReq: ListComponentVersionsRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListComponentVersionsResponse {
  Util.validateModel(tmpReq);
  var request = new ListComponentVersionsShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.platforms)) {
    request.platformsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.platforms, 'platforms', 'json');
  }
  var query : map[string]any = {};
  if (!Util.isUnset(request.pageNum)) {
    query['pageNum'] = request.pageNum;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['pageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.platformsShrink)) {
    query['platforms'] = request.platformsShrink;
  }
  if (!Util.isUnset(request.version)) {
    query['version'] = request.version;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListComponentVersions',
    version = '2021-07-20',
    protocol = 'HTTPS',
    pathname = `/api/v2/components/${OpenApiUtil.getEncodeParam(uid)}/versions`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listComponentVersions(uid: string, request: ListComponentVersionsRequest): ListComponentVersionsResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listComponentVersionsWithOptions(uid, request, headers, runtime);
}

model ListComponentsRequest {
  category?: string(name='category', example='SAAS'),
  fuzzy?: string(name='fuzzy', example='name'),
  name?: string(name='name', example='component-name'),
  pageNum?: int32(name='pageNum', example='1'),
  pageSize?: int32(name='pageSize', example='10'),
  public?: boolean(name='public', example='false'),
}

model ListComponentsResponseBody = {
  code?: string(name='code', example='Success'),
  data?: {
    list?: [ 
      {
        annotations?: {
          annotations?: string(name='annotations'),
        }(name='annotations'),
        category?: string(name='category', example='SAAS'),
        description?: string(name='description', example='test'),
        documents?: string(name='documents'),
        name?: string(name='name', example='test'),
        provider?: string(name='provider'),
        public?: boolean(name='public', example='false'),
        singleton?: boolean(name='singleton', example='false'),
        source?: string(name='source', example='aliyun-inc.com'),
        uid?: string(name='uid', example='62cd4869-71b4-4c9f-b6c4-xxxxxxxxxxxx'),
      }
    ](name='list'),
    pageNum?: int32(name='pageNum', example='1'),
    pageSize?: int32(name='pageSize', example='10'),
    total?: int32(name='total', example='100'),
  }(name='data'),
  msg?: string(name='msg', example='Success'),
}

model ListComponentsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListComponentsResponseBody(name='body'),
}

async function listComponentsWithOptions(request: ListComponentsRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListComponentsResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.category)) {
    query['category'] = request.category;
  }
  if (!Util.isUnset(request.fuzzy)) {
    query['fuzzy'] = request.fuzzy;
  }
  if (!Util.isUnset(request.name)) {
    query['name'] = request.name;
  }
  if (!Util.isUnset(request.pageNum)) {
    query['pageNum'] = request.pageNum;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['pageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.public)) {
    query['public'] = request.public;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListComponents',
    version = '2021-07-20',
    protocol = 'HTTPS',
    pathname = `/api/v2/components`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listComponents(request: ListComponentsRequest): ListComponentsResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listComponentsWithOptions(request, headers, runtime);
}

model ListDeliveryInstanceChangeRecordsResponseBody = {
  code?: string(name='code', example='Success'),
  data?: [ 
    {
      deliverableUID?: string(name='deliverableUID', example='deliver-glXKBVYg8qBL'),
      envChangeRecords?: map[string]any(name='envChangeRecords'),
      envNodeInfo?: [ 
        {
          capacity?: string(name='capacity', example='1530'),
          cpu?: string(name='cpu', example='64'),
          identifier?: string(name='identifier', example='master'),
          label?: map[string]any(name='label'),
          memory?: string(name='memory', example='128'),
          name?: string(name='name', example='qimr'),
          privateIP?: string(name='privateIP', example='192.168.0.1'),
          taints?: map[string]any(name='taints'),
        }
      ](name='envNodeInfo'),
      envPackageConfig?: string(name='envPackageConfig', example='clusterId: dbd9be27-a21d-46f7-b1f0-8c9e383a9099
cluster:
  spec:
    network:
      cniName: calico
      podCIDR: 100.64.0.0/16
      svcCIDR: 10.96.0.0/16
products:
  cy-robot:
    version: 1.0.2
    components:
      robot:
        ROBOT_NUM: \\"2\\"
    namespace: cy-robot
nodes: []
global: {}
system: {}
operator:
  cert: |
    -----BEGIN PUBLIC KEY-----
    
    -----END PUBLIC KEY-----
applicationModel: \\"\\"'),
      originDeliverableUID?: string(name='originDeliverableUID', example='deliver-5OQqK2lMlzZV'),
      uid?: string(name='uid', example='delivery-rec-wMVj9Kp4XW7r'),
    }
  ](name='data'),
  msg?: string(name='msg', example='succeed in handling request'),
}

model ListDeliveryInstanceChangeRecordsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListDeliveryInstanceChangeRecordsResponseBody(name='body'),
}

async function listDeliveryInstanceChangeRecordsWithOptions(uid: string, headers: map[string]string, runtime: Util.RuntimeOptions): ListDeliveryInstanceChangeRecordsResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApi.Params{
    action = 'ListDeliveryInstanceChangeRecords',
    version = '2021-07-20',
    protocol = 'HTTPS',
    pathname = `/api/v2/delivery/delivery-instances/${OpenApiUtil.getEncodeParam(uid)}/delivery-records`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listDeliveryInstanceChangeRecords(uid: string): ListDeliveryInstanceChangeRecordsResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listDeliveryInstanceChangeRecordsWithOptions(uid, headers, runtime);
}

model ListDeliveryPackageRequest {
  deliverableUID?: string(name='deliverableUID', example='deliver-lP4pO6yRPqV6'),
  platform?: string(name='platform'),
}

model ListDeliveryPackageResponseBody = {
  code?: string(name='code', example='Success'),
  data?: [ 
    {
      deliverableUID?: string(name='deliverableUID', example='deliver-5MRxYz00PvMk'),
      originDeliverableUID?: string(name='originDeliverableUID', example='deliver-ovAgJx80B9ZV'),
      packageContentType?: string(name='packageContentType', example='application'),
      packageSize?: string(name='packageSize', example='3.97GB'),
      packageStatus?: string(name='packageStatus', example='Success'),
      packageType?: string(name='packageType', example='full'),
      packageUID?: string(name='packageUID', example='1c33e7b7-2df8-4632-9f94-e1d98caa410d'),
      packageURL?: string(name='packageURL', example='https://cn-shanghai-cnx-packages.oss-cn-shanghai.aliyuncs.com/products/xxxxxxxxxxxxxxxxxx'),
      platform?: string(name='platform', example='linux/amd64'),
    }
  ](name='data'),
  msg?: string(name='msg', example='succeed in handling request'),
}

model ListDeliveryPackageResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListDeliveryPackageResponseBody(name='body'),
}

async function listDeliveryPackageWithOptions(request: ListDeliveryPackageRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListDeliveryPackageResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.deliverableUID)) {
    query['deliverableUID'] = request.deliverableUID;
  }
  if (!Util.isUnset(request.platform)) {
    query['platform'] = request.platform;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListDeliveryPackage',
    version = '2021-07-20',
    protocol = 'HTTPS',
    pathname = `/api/v2/delivery/delivery-packages`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listDeliveryPackage(request: ListDeliveryPackageRequest): ListDeliveryPackageResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listDeliveryPackageWithOptions(request, headers, runtime);
}

model ListEnvironmentLicensesRequest {
  pageNum?: int32(name='pageNum', example='1'),
  pageSize?: int32(name='pageSize', example='10'),
  scope?: string(name='scope', example='foundation'),
  type?: string(name='type', example='Production'),
}

model ListEnvironmentLicensesResponseBody = {
  code?: string(name='code', example='Success'),
  data?: {
    list?: [ 
      {
        expireTime?: string(name='expireTime', example='2122-05-10T19:42:15+08:00'),
        licenseKey?: string(name='licenseKey', example='sKSQqgNrIhSL46z44zmNdCTfswaz5qM4inMHUMuCOtnIif4sNaor5U57iuDgrQLDNowllLht1gscn9/5jvhLbaPX5/BsdIqcTG2CVsQdu1g9Jhntw70h3upoWJFzEEo/+hOLRjjGPxWAiDwCflscDlL6JhMJq4tI7Uh/tPx8X7xtIyvH09DJdONfh54hznJrofmLyvrmkqt8VaM5ZPXsLDhetoYcXVCjc4fgSF3t3m+LCFevZKiIjwYc0TMirHZACjU2L0o3ovPzT5crpRafHV3B5GhBPuTlEZ7azdRs2tOKPj/56mPA1mv9easgheGcibeblo+Fnwf/S5CcADfzAwkKCO/57joJu6Wwwnw+VtRcbi2+Eiw7/wohBze8nS6G9J/arjJdmiOyQQ1FTY47mB71x05aFg+ZiLosfZigHG0XgTFx1Is63l6cpfECdCkRh5CwdtOi4Eceto3svcJO1dddBAtcPsYCbtqw8Los38KILlXSVVEgHAhBqHxudAHnZ27CX/z5tizLg6+jNEVpyRJCA1Vm+zAzVJ62xxxxxxxx='),
        licenseQuota?: {
          clusterQuota?: {
            cpuCoreLimit?: int32(name='cpuCoreLimit', example='100'),
          }(name='clusterQuota'),
          componentQuotas?: [ 
            {
              componentName?: string(name='componentName', example='test-component'),
              componentSource?: string(name='componentSource', example='aliyun-inc.com'),
              instanceLimit?: int32(name='instanceLimit', example='1'),
            }
          ](name='componentQuotas'),
          customQuotas?: [ 
            {
              description?: string(name='description', example='description'),
              key?: string(name='key', example='name'),
              value?: string(name='value', example='aliyun'),
            }
          ](name='customQuotas'),
        }(name='licenseQuota'),
        productVersionUID?: string(name='productVersionUID', example='e61f944c-c021-46bd-a877-xxxxxxxxxxxx'),
        rejectReason?: string(name='rejectReason'),
        scope?: string(name='scope', example='foundation'),
        status?: string(name='status', example='approved'),
        type?: string(name='type', example='OnTrial'),
        uid?: string(name='uid', example='3c35c6fa-c080-444b-89ac-xxxxxxxxxxxx'),
      }
    ](name='list'),
    pageNum?: int32(name='pageNum', example='1'),
    pageSize?: int32(name='pageSize', example='10'),
    total?: int32(name='total', example='100'),
  }(name='data'),
  msg?: string(name='msg', example='Success'),
}

model ListEnvironmentLicensesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListEnvironmentLicensesResponseBody(name='body'),
}

async function listEnvironmentLicensesWithOptions(uid: string, request: ListEnvironmentLicensesRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListEnvironmentLicensesResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.pageNum)) {
    query['pageNum'] = request.pageNum;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['pageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.scope)) {
    query['scope'] = request.scope;
  }
  if (!Util.isUnset(request.type)) {
    query['type'] = request.type;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListEnvironmentLicenses',
    version = '2021-07-20',
    protocol = 'HTTPS',
    pathname = `/api/v2/environments/${OpenApiUtil.getEncodeParam(uid)}/licenses`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listEnvironmentLicenses(uid: string, request: ListEnvironmentLicensesRequest): ListEnvironmentLicensesResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listEnvironmentLicensesWithOptions(uid, request, headers, runtime);
}

model ListEnvironmentNodesRequest {
  pageNum?: int32(name='pageNum', example='1'),
  pageSize?: int32(name='pageSize', example='10'),
}

model ListEnvironmentNodesResponseBody = {
  code?: string(name='code', example='Success'),
  data?: {
    list?: [
      InstanceInfo
    ](name='list'),
    pageNum?: long(name='pageNum', example='1'),
    pageSize?: long(name='pageSize', example='10'),
    total?: long(name='total', example='100'),
  }(name='data'),
  msg?: string(name='msg', example='Success'),
}

model ListEnvironmentNodesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListEnvironmentNodesResponseBody(name='body'),
}

async function listEnvironmentNodesWithOptions(uid: string, request: ListEnvironmentNodesRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListEnvironmentNodesResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.pageNum)) {
    query['pageNum'] = request.pageNum;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['pageSize'] = request.pageSize;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListEnvironmentNodes',
    version = '2021-07-20',
    protocol = 'HTTPS',
    pathname = `/api/v2/environments/${OpenApiUtil.getEncodeParam(uid)}/nodes`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listEnvironmentNodes(uid: string, request: ListEnvironmentNodesRequest): ListEnvironmentNodesResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listEnvironmentNodesWithOptions(uid, request, headers, runtime);
}

model ListEnvironmentTunnelsResponseBody = {
  code?: string(name='code', example='Success'),
  data?: {
    list?: [ 
      {
        tunnelConfig?: {
          hostname?: string(name='hostname', example='43.183.xx.xx'),
          password?: string(name='password', example='paasword'),
          regionId?: string(name='regionId', example='cn-hangzhou'),
          sshPort?: int32(name='sshPort', example='22'),
          username?: string(name='username', example='root'),
          vpcId?: string(name='vpcId', example='vpc-uf6cj8ytglguhhxxxxxxxx'),
        }(name='tunnelConfig'),
        tunnelType?: string(name='tunnelType', example='jumpServer'),
      }
    ](name='list'),
  }(name='data'),
  msg?: string(name='msg', example='Success'),
}

model ListEnvironmentTunnelsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListEnvironmentTunnelsResponseBody(name='body'),
}

async function listEnvironmentTunnelsWithOptions(uid: string, headers: map[string]string, runtime: Util.RuntimeOptions): ListEnvironmentTunnelsResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApi.Params{
    action = 'ListEnvironmentTunnels',
    version = '2021-07-20',
    protocol = 'HTTPS',
    pathname = `/api/v2/environments/${OpenApiUtil.getEncodeParam(uid)}/tunnels`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listEnvironmentTunnels(uid: string): ListEnvironmentTunnelsResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listEnvironmentTunnelsWithOptions(uid, headers, runtime);
}

model ListEnvironmentsRequest {
  clusterUID?: string(name='clusterUID', example='1f597e3d-6c11-4ed9-8f59-xxx'),
  endpoint?: string(name='endpoint'),
  foundationType?: string(name='foundationType', example='trident'),
  fuzzy?: string(name='fuzzy', example='name'),
  instanceStatus?: string(name='instanceStatus', example='INITING'),
  name?: string(name='name'),
  pageNum?: int32(name='pageNum', example='1'),
  pageSize?: int32(name='pageSize', example='10'),
  type?: string(name='type', example='production'),
  vendorType?: string(name='vendorType', example='alicloud'),
}

model ListEnvironmentsResponseBody = {
  code?: string(name='code', example='Success'),
  data?: {
    list?: [ 
      {
        createdAt?: string(name='createdAt', example='2022-05-11T00:00:00+08:00'),
        description?: string(name='description'),
        expireAt?: string(name='expireAt'),
        instanceStatus?: string(name='instanceStatus'),
        location?: string(name='location'),
        name?: string(name='name', example='env-demo'),
        platform?: {
          architecture?: string(name='architecture', example='amd64'),
          os?: string(name='os', example='linux'),
        }(name='platform'),
        platformList?: [
          Platform
        ](name='platformList'),
        platformStatus?: string(name='platformStatus'),
        productName?: string(name='productName', example='demo-product'),
        productVersion?: string(name='productVersion', example='v1.0.0'),
        productVersionUID?: string(name='productVersionUID', example='fea3185f-027c-484f-9570-xxx'),
        uid?: string(name='uid', example='b8ec63af-7859-4464-9cff-xxx'),
        vendorType?: string(name='vendorType', example='alicloud'),
      }
    ](name='list'),
    pageNum?: int32(name='pageNum', example='1'),
    pageSize?: int32(name='pageSize', example='10'),
    total?: int32(name='total', example='100'),
  }(name='data'),
  msg?: string(name='msg', example='Success'),
}

model ListEnvironmentsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListEnvironmentsResponseBody(name='body'),
}

async function listEnvironmentsWithOptions(request: ListEnvironmentsRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListEnvironmentsResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.clusterUID)) {
    query['clusterUID'] = request.clusterUID;
  }
  if (!Util.isUnset(request.endpoint)) {
    query['endpoint'] = request.endpoint;
  }
  if (!Util.isUnset(request.foundationType)) {
    query['foundationType'] = request.foundationType;
  }
  if (!Util.isUnset(request.fuzzy)) {
    query['fuzzy'] = request.fuzzy;
  }
  if (!Util.isUnset(request.instanceStatus)) {
    query['instanceStatus'] = request.instanceStatus;
  }
  if (!Util.isUnset(request.name)) {
    query['name'] = request.name;
  }
  if (!Util.isUnset(request.pageNum)) {
    query['pageNum'] = request.pageNum;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['pageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.type)) {
    query['type'] = request.type;
  }
  if (!Util.isUnset(request.vendorType)) {
    query['vendorType'] = request.vendorType;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListEnvironments',
    version = '2021-07-20',
    protocol = 'HTTPS',
    pathname = `/api/v2/environments`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listEnvironments(request: ListEnvironmentsRequest): ListEnvironmentsResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listEnvironmentsWithOptions(request, headers, runtime);
}

model ListFoundationComponentVersionsRequest {
  onlyEnabled?: boolean(name='onlyEnabled'),
  parentComponentRelationUID?: string(name='parentComponentRelationUID'),
}

model ListFoundationComponentVersionsResponseBody = {
  code?: string(name='code', example='Success'),
  data?: {
    list?: [
      ComponentVersion
    ](name='list'),
    pageNum?: int32(name='pageNum', example='1'),
    pageSize?: int32(name='pageSize', example='10'),
    total?: int32(name='total', example='100'),
  }(name='data'),
  msg?: string(name='msg', example='Success'),
}

model ListFoundationComponentVersionsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListFoundationComponentVersionsResponseBody(name='body'),
}

async function listFoundationComponentVersionsWithOptions(uid: string, request: ListFoundationComponentVersionsRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListFoundationComponentVersionsResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.onlyEnabled)) {
    query['onlyEnabled'] = request.onlyEnabled;
  }
  if (!Util.isUnset(request.parentComponentRelationUID)) {
    query['parentComponentRelationUID'] = request.parentComponentRelationUID;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListFoundationComponentVersions',
    version = '2021-07-20',
    protocol = 'HTTPS',
    pathname = `/api/v2/foundation/versions/${OpenApiUtil.getEncodeParam(uid)}/component-versions`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listFoundationComponentVersions(uid: string, request: ListFoundationComponentVersionsRequest): ListFoundationComponentVersionsResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listFoundationComponentVersionsWithOptions(uid, request, headers, runtime);
}

model ListFoundationReferenceComponentsRequest {
  foundationReferenceUID?: string(name='foundationReferenceUID', example='d5246b4b-b058-41df-84d0-xxx'),
  foundationVersionUID?: string(name='foundationVersionUID', example='4686a7d7-04b4-4101-9466-xxx'),
  onlyEnabled?: boolean(name='onlyEnabled', example='false'),
  parentComponentReferenceUID?: string(name='parentComponentReferenceUID'),
  productVersionUID?: string(name='productVersionUID', example='c67144dc-92a2-4269-a886-xxx'),
}

model ListFoundationReferenceComponentsResponseBody = {
  code?: string(name='code', example='Success'),
  data?: [
    ProductComponentRelationDetail
  ](name='data'),
  msg?: string(name='msg', example='Success'),
}

model ListFoundationReferenceComponentsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListFoundationReferenceComponentsResponseBody(name='body'),
}

async function listFoundationReferenceComponentsWithOptions(request: ListFoundationReferenceComponentsRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListFoundationReferenceComponentsResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.foundationReferenceUID)) {
    query['foundationReferenceUID'] = request.foundationReferenceUID;
  }
  if (!Util.isUnset(request.foundationVersionUID)) {
    query['foundationVersionUID'] = request.foundationVersionUID;
  }
  if (!Util.isUnset(request.onlyEnabled)) {
    query['onlyEnabled'] = request.onlyEnabled;
  }
  if (!Util.isUnset(request.parentComponentReferenceUID)) {
    query['parentComponentReferenceUID'] = request.parentComponentReferenceUID;
  }
  if (!Util.isUnset(request.productVersionUID)) {
    query['productVersionUID'] = request.productVersionUID;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListFoundationReferenceComponents',
    version = '2021-07-20',
    protocol = 'HTTPS',
    pathname = `/api/v2/foundation-references/component-versions`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listFoundationReferenceComponents(request: ListFoundationReferenceComponentsRequest): ListFoundationReferenceComponentsResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listFoundationReferenceComponentsWithOptions(request, headers, runtime);
}

model ListFoundationVersionsRequest {
  onlyDefault?: boolean(name='onlyDefault'),
  pageNum?: int32(name='pageNum'),
  pageSize?: int32(name='pageSize'),
  sortDirect?: string(name='sortDirect', example='ENUM:["DESC","ASC"]'),
  sortKey?: string(name='sortKey', example='"created_at"/"sequence"'),
  type?: string(name='type', example='ENUM:["trident","ack"]'),
  version?: string(name='version'),
}

model ListFoundationVersionsResponseBody = {
  code?: string(name='code', example='Success'),
  data?: {
    list?: [
      FoundationVersion
    ](name='list'),
  }(name='data'),
  msg?: string(name='msg', example='Success'),
}

model ListFoundationVersionsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListFoundationVersionsResponseBody(name='body'),
}

async function listFoundationVersionsWithOptions(request: ListFoundationVersionsRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListFoundationVersionsResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.onlyDefault)) {
    query['onlyDefault'] = request.onlyDefault;
  }
  if (!Util.isUnset(request.pageNum)) {
    query['pageNum'] = request.pageNum;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['pageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.sortDirect)) {
    query['sortDirect'] = request.sortDirect;
  }
  if (!Util.isUnset(request.sortKey)) {
    query['sortKey'] = request.sortKey;
  }
  if (!Util.isUnset(request.type)) {
    query['type'] = request.type;
  }
  if (!Util.isUnset(request.version)) {
    query['version'] = request.version;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListFoundationVersions',
    version = '2021-07-20',
    protocol = 'HTTPS',
    pathname = `/api/v2/foundation/versions`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listFoundationVersions(request: ListFoundationVersionsRequest): ListFoundationVersionsResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listFoundationVersionsWithOptions(request, headers, runtime);
}

model ListProductComponentVersionsRequest {
  category?: string(name='category', example='SAAS'),
  pageNum?: string(name='pageNum', example='1'),
  pageSize?: string(name='pageSize', example='10'),
  releaseName?: string(name='releaseName'),
  sortDirect?: string(name='sortDirect', example='ASC'),
  sortKey?: string(name='sortKey', example='created_at'),
}

model ListProductComponentVersionsResponseBody = {
  code?: string(name='code', example='Success'),
  data?: {
    list?: [
      ProductComponentRelationDetail
    ](name='list'),
    pageNum?: long(name='pageNum', example='1'),
    pageSize?: long(name='pageSize', example='10'),
    total?: long(name='total', example='100'),
  }(name='data'),
  msg?: string(name='msg', example='Success'),
}

model ListProductComponentVersionsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListProductComponentVersionsResponseBody(name='body'),
}

async function listProductComponentVersionsWithOptions(uid: string, request: ListProductComponentVersionsRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListProductComponentVersionsResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.category)) {
    query['category'] = request.category;
  }
  if (!Util.isUnset(request.pageNum)) {
    query['pageNum'] = request.pageNum;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['pageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.releaseName)) {
    query['releaseName'] = request.releaseName;
  }
  if (!Util.isUnset(request.sortDirect)) {
    query['sortDirect'] = request.sortDirect;
  }
  if (!Util.isUnset(request.sortKey)) {
    query['sortKey'] = request.sortKey;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListProductComponentVersions',
    version = '2021-07-20',
    protocol = 'HTTPS',
    pathname = `/api/v2/product-versions/${OpenApiUtil.getEncodeParam(uid)}/component-versions`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listProductComponentVersions(uid: string, request: ListProductComponentVersionsRequest): ListProductComponentVersionsResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listProductComponentVersionsWithOptions(uid, request, headers, runtime);
}

model ListProductDeploymentsRequest {
  environmentUID?: string(name='environmentUID', example='caf855b8-8c30-498e-96af-xxx'),
  pageNum?: int32(name='pageNum', example='1'),
  pageSize?: int32(name='pageSize', example='10'),
  productVersionUID?: string(name='productVersionUID', example='3ae49e0d-676c-45a5-8f0e-xxx'),
}

model ListProductDeploymentsResponseBody = {
  code?: string(name='code', example='Success'),
  data?: {
    list?: [ 
      {
        envParams?: string(name='envParams'),
        envUID?: string(name='envUID', example='b8ec63af-7859-4464-9cff-xxx'),
        oldProductVersion?: string(name='oldProductVersion', example='1.0.1'),
        packageContentType?: string(name='packageContentType', example='all'),
        packageInfoUID?: string(name='packageInfoUID', example='dc78905e-f03f-4759-932e-xxx'),
        packageType?: string(name='packageType', example='full'),
        productName?: string(name='productName', example='demo-product'),
        productVersion?: string(name='productVersion', example='1.0.2'),
        status?: string(name='status', example='Success'),
        uid?: string(name='uid', example='5699b683-075a-4c51-a78c-xxx'),
      }
    ](name='list'),
    pageNum?: int32(name='pageNum', example='1'),
    pageSize?: int32(name='pageSize', example='10'),
    total?: int32(name='total', example='100'),
  }(name='data'),
  msg?: string(name='msg', example='Success'),
}

model ListProductDeploymentsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListProductDeploymentsResponseBody(name='body'),
}

async function listProductDeploymentsWithOptions(request: ListProductDeploymentsRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListProductDeploymentsResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.environmentUID)) {
    query['environmentUID'] = request.environmentUID;
  }
  if (!Util.isUnset(request.pageNum)) {
    query['pageNum'] = request.pageNum;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['pageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.productVersionUID)) {
    query['productVersionUID'] = request.productVersionUID;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListProductDeployments',
    version = '2021-07-20',
    protocol = 'HTTPS',
    pathname = `/api/v2/product-instances/deployments`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listProductDeployments(request: ListProductDeploymentsRequest): ListProductDeploymentsResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listProductDeploymentsWithOptions(request, headers, runtime);
}

model ListProductEnvironmentsRequest {
  compatibleProductVersionUID?: string(name='compatibleProductVersionUID'),
  envType?: string(name='envType'),
  options?: {
    filterWithSpecUID?: boolean(name='filterWithSpecUID'),
    specUID?: string(name='specUID'),
  }(name='options'),
  platforms?: [ 
    {
      architecture?: string(name='architecture'),
      os?: string(name='os'),
    }
  ](name='platforms'),
  productVersionSpecUID?: string(name='productVersionSpecUID'),
  productVersionUID?: string(name='productVersionUID'),
}

model ListProductEnvironmentsShrinkRequest {
  compatibleProductVersionUID?: string(name='compatibleProductVersionUID'),
  envType?: string(name='envType'),
  optionsShrink?: string(name='options'),
  platformsShrink?: string(name='platforms'),
  productVersionSpecUID?: string(name='productVersionSpecUID'),
  productVersionUID?: string(name='productVersionUID'),
}

model ListProductEnvironmentsResponseBody = {
  code?: string(name='code'),
  data?: [ 
    {
      envName?: string(name='envName'),
      envType?: string(name='envType'),
      envUID?: string(name='envUID'),
      instanceStatus?: string(name='instanceStatus', example='实例状态'),
      oldProductVersion?: string(name='oldProductVersion'),
      oldProductVersionUID?: string(name='oldProductVersionUID'),
      platformStatus?: string(name='platformStatus'),
      productName?: string(name='productName'),
      productUID?: string(name='productUID'),
      productVersion?: string(name='productVersion'),
      productVersionUID?: string(name='productVersionUID'),
      provider?: string(name='provider'),
      uid?: string(name='uid'),
      vendorConfig?: string(name='vendorConfig'),
      vendorType?: string(name='vendorType', example='环境类型'),
    }
  ](name='data'),
  msg?: string(name='msg'),
}

model ListProductEnvironmentsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListProductEnvironmentsResponseBody(name='body'),
}

async function listProductEnvironmentsWithOptions(uid: string, tmpReq: ListProductEnvironmentsRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListProductEnvironmentsResponse {
  Util.validateModel(tmpReq);
  var request = new ListProductEnvironmentsShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.options)) {
    request.optionsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.options, 'options', 'json');
  }
  if (!Util.isUnset(tmpReq.platforms)) {
    request.platformsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.platforms, 'platforms', 'json');
  }
  var query : map[string]any = {};
  if (!Util.isUnset(request.compatibleProductVersionUID)) {
    query['compatibleProductVersionUID'] = request.compatibleProductVersionUID;
  }
  if (!Util.isUnset(request.envType)) {
    query['envType'] = request.envType;
  }
  if (!Util.isUnset(request.optionsShrink)) {
    query['options'] = request.optionsShrink;
  }
  if (!Util.isUnset(request.platformsShrink)) {
    query['platforms'] = request.platformsShrink;
  }
  if (!Util.isUnset(request.productVersionSpecUID)) {
    query['productVersionSpecUID'] = request.productVersionSpecUID;
  }
  if (!Util.isUnset(request.productVersionUID)) {
    query['productVersionUID'] = request.productVersionUID;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListProductEnvironments',
    version = '2021-07-20',
    protocol = 'HTTPS',
    pathname = `/api/v2/hosting/products/${OpenApiUtil.getEncodeParam(uid)}/environments`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listProductEnvironments(uid: string, request: ListProductEnvironmentsRequest): ListProductEnvironmentsResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listProductEnvironmentsWithOptions(uid, request, headers, runtime);
}

model ListProductFoundationReferencesResponseBody = {
  code?: string(name='code', example='Success'),
  data?: [ 
    {
      foundationReferenceUID?: string(name='foundationReferenceUID', example='b1b528a6-8341-4f06-89af-xxxxxxxxxxxx'),
      foundationVersion?: string(name='foundationVersion', example='1.4.3'),
      foundationVersionName?: string(name='foundationVersionName'),
      foundationVersionType?: string(name='foundationVersionType', example='trident'),
      foundationVersionUID?: string(name='foundationVersionUID', example='796f9044-8684-4de5-9b12-xxxxxxxxxxxx'),
      productVersionUID?: string(name='productVersionUID', example='e61f944c-c021-46bd-a877-xxxxxxxxxxxx'),
    }
  ](name='data'),
  msg?: string(name='msg', example='Success'),
}

model ListProductFoundationReferencesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListProductFoundationReferencesResponseBody(name='body'),
}

/**
  * @deprecated
  *
  * @param headers map
  * @param runtime runtime options for this request RuntimeOptions
  * @return ListProductFoundationReferencesResponse
 */
// Deprecated
async function listProductFoundationReferencesWithOptions(uid: string, headers: map[string]string, runtime: Util.RuntimeOptions): ListProductFoundationReferencesResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApi.Params{
    action = 'ListProductFoundationReferences',
    version = '2021-07-20',
    protocol = 'HTTPS',
    pathname = `/api/v2/product-versions/${OpenApiUtil.getEncodeParam(uid)}/foundation-references`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
  * @deprecated
  *
  * @return ListProductFoundationReferencesResponse
 */
// Deprecated
async function listProductFoundationReferences(uid: string): ListProductFoundationReferencesResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listProductFoundationReferencesWithOptions(uid, headers, runtime);
}

model ListProductInstanceConfigsRequest {
  componentReleaseName?: string(name='componentReleaseName'),
  environmentUID?: string(name='environmentUID'),
  fuzzy?: string(name='fuzzy'),
  pageNum?: int32(name='pageNum'),
  pageSize?: int32(name='pageSize'),
  paramType?: string(name='paramType', example='component/global'),
  parameter?: string(name='parameter'),
  productVersionUID?: string(name='productVersionUID'),
}

model ListProductInstanceConfigsResponseBody = {
  code?: string(name='code'),
  data?: {
    list?: [ 
      {
        componentName?: string(name='componentName'),
        componentReleaseName?: string(name='componentReleaseName'),
        componentUID?: string(name='componentUID'),
        componentVersionUID?: string(name='componentVersionUID'),
        createdAt?: string(name='createdAt'),
        description?: string(name='description'),
        envUID?: string(name='envUID'),
        name?: string(name='name'),
        parentComponentName?: string(name='parentComponentName'),
        parentComponentReleaseName?: string(name='parentComponentReleaseName'),
        parentComponentVersionUID?: string(name='parentComponentVersionUID'),
        productName?: string(name='productName'),
        productVersion?: string(name='productVersion'),
        productVersionUID?: string(name='productVersionUID'),
        uid?: string(name='uid'),
        value?: string(name='value'),
        valueType?: string(name='valueType'),
        vendorType?: string(name='vendorType'),
      }
    ](name='list'),
    pageNum?: int32(name='pageNum'),
    pageSize?: int32(name='pageSize'),
    total?: int32(name='total'),
  }(name='data'),
  msg?: string(name='msg'),
}

model ListProductInstanceConfigsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListProductInstanceConfigsResponseBody(name='body'),
}

async function listProductInstanceConfigsWithOptions(request: ListProductInstanceConfigsRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListProductInstanceConfigsResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.componentReleaseName)) {
    query['componentReleaseName'] = request.componentReleaseName;
  }
  if (!Util.isUnset(request.environmentUID)) {
    query['environmentUID'] = request.environmentUID;
  }
  if (!Util.isUnset(request.fuzzy)) {
    query['fuzzy'] = request.fuzzy;
  }
  if (!Util.isUnset(request.pageNum)) {
    query['pageNum'] = request.pageNum;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['pageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.paramType)) {
    query['paramType'] = request.paramType;
  }
  if (!Util.isUnset(request.parameter)) {
    query['parameter'] = request.parameter;
  }
  if (!Util.isUnset(request.productVersionUID)) {
    query['productVersionUID'] = request.productVersionUID;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListProductInstanceConfigs',
    version = '2021-07-20',
    protocol = 'HTTPS',
    pathname = `/api/v2/product-instances/configs`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listProductInstanceConfigs(request: ListProductInstanceConfigsRequest): ListProductInstanceConfigsResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listProductInstanceConfigsWithOptions(request, headers, runtime);
}

model ListProductInstancesRequest {
  envUID?: string(name='envUID', example='b8ec63af-7859-4464-9cff-xxx'),
  options?: {
    filterWithSpecUID?: boolean(name='filterWithSpecUID'),
    specUID?: string(name='specUID'),
  }(name='options'),
  pageNum?: int32(name='pageNum', example='1'),
  pageSize?: int32(name='pageSize', example='10'),
  productVersionUID?: string(name='productVersionUID', example='a38eaad7-d1e7-4395-8d8a-xxx'),
}

model ListProductInstancesShrinkRequest {
  envUID?: string(name='envUID', example='b8ec63af-7859-4464-9cff-xxx'),
  optionsShrink?: string(name='options'),
  pageNum?: int32(name='pageNum', example='1'),
  pageSize?: int32(name='pageSize', example='10'),
  productVersionUID?: string(name='productVersionUID', example='a38eaad7-d1e7-4395-8d8a-xxx'),
}

model ListProductInstancesResponseBody = {
  code?: string(name='code'),
  data?: {
    list?: [ 
      {
        clusterUID?: string(name='clusterUID'),
        continuousDeployment?: boolean(name='continuousDeployment'),
        namespace?: string(name='namespace'),
        productName?: string(name='productName', example='demo-product'),
        productUID?: string(name='productUID'),
        productVersion?: string(name='productVersion', example='v1.0.0'),
        productVersionSpecUID?: string(name='productVersionSpecUID'),
        productVersionUID?: string(name='productVersionUID', example='17c62480-8d60-482d-b1bc-xxx'),
        status?: string(name='status', example='INITIALIZING'),
        timeout?: long(name='timeout'),
        uid?: string(name='uid', example='7f15e716-acfe-4ebe-8def-xxx'),
      }
    ](name='list'),
    pageNum?: int32(name='pageNum'),
    pageSize?: int32(name='pageSize'),
    total?: int32(name='total'),
  }(name='data'),
  msg?: string(name='msg'),
}

model ListProductInstancesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListProductInstancesResponseBody(name='body'),
}

async function listProductInstancesWithOptions(tmpReq: ListProductInstancesRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListProductInstancesResponse {
  Util.validateModel(tmpReq);
  var request = new ListProductInstancesShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.options)) {
    request.optionsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.options, 'options', 'json');
  }
  var query : map[string]any = {};
  if (!Util.isUnset(request.envUID)) {
    query['envUID'] = request.envUID;
  }
  if (!Util.isUnset(request.optionsShrink)) {
    query['options'] = request.optionsShrink;
  }
  if (!Util.isUnset(request.pageNum)) {
    query['pageNum'] = request.pageNum;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['pageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.productVersionUID)) {
    query['productVersionUID'] = request.productVersionUID;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListProductInstances',
    version = '2021-07-20',
    protocol = 'HTTPS',
    pathname = `/api/v2/product-instances`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listProductInstances(request: ListProductInstancesRequest): ListProductInstancesResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listProductInstancesWithOptions(request, headers, runtime);
}

model ListProductVersionConfigsRequest {
  componentReleaseName?: string(name='componentReleaseName'),
  configType?: string(name='configType', example='component'),
  fuzzy?: string(name='fuzzy'),
  pageNum?: string(name='pageNum', example='1'),
  pageSize?: string(name='pageSize', example='10'),
  parameter?: string(name='parameter'),
  scope?: string(name='scope'),
}

model ListProductVersionConfigsResponseBody = {
  code?: string(name='code', example='Success'),
  data?: {
    list?: [ 
      {
        componentName?: string(name='componentName', example='component'),
        componentReleaseName?: string(name='componentReleaseName', example='component'),
        componentVersionUID?: string(name='componentVersionUID', example='9963a9ec-95d0-4e82-88c8-xxxxxxxxxxxx'),
        description?: string(name='description', example='config'),
        name?: string(name='name', example='key'),
        parentComponentName?: string(name='parentComponentName', example='parent-component'),
        parentComponentReleaseName?: string(name='parentComponentReleaseName', example='parent-component'),
        parentComponentVersionUID?: string(name='parentComponentVersionUID', example='d415e042-c4be-4707-9bda-xxxxxxxxxxxx'),
        productVersionUID?: string(name='productVersionUID', example='e61f944c-c021-46bd-a877-xxxxxxxxxxxx'),
        scope?: string(name='scope'),
        uid?: string(name='uid', example='fd460c2f-1d81-428d-81f7-xxxxxxxxxxxx'),
        value?: string(name='value', example='value'),
        valueType?: string(name='valueType'),
      }
    ](name='list'),
    pageNum?: int32(name='pageNum', example='1'),
    pageSize?: int32(name='pageSize', example='10'),
    total?: int32(name='total', example='100'),
  }(name='data'),
  msg?: string(name='msg', example='Success'),
}

model ListProductVersionConfigsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListProductVersionConfigsResponseBody(name='body'),
}

async function listProductVersionConfigsWithOptions(uid: string, request: ListProductVersionConfigsRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListProductVersionConfigsResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.componentReleaseName)) {
    query['componentReleaseName'] = request.componentReleaseName;
  }
  if (!Util.isUnset(request.configType)) {
    query['configType'] = request.configType;
  }
  if (!Util.isUnset(request.fuzzy)) {
    query['fuzzy'] = request.fuzzy;
  }
  if (!Util.isUnset(request.pageNum)) {
    query['pageNum'] = request.pageNum;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['pageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.parameter)) {
    query['parameter'] = request.parameter;
  }
  if (!Util.isUnset(request.scope)) {
    query['scope'] = request.scope;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListProductVersionConfigs',
    version = '2021-07-20',
    protocol = 'HTTPS',
    pathname = `/api/v2/product-versions/${OpenApiUtil.getEncodeParam(uid)}/configs`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listProductVersionConfigs(uid: string, request: ListProductVersionConfigsRequest): ListProductVersionConfigsResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listProductVersionConfigsWithOptions(uid, request, headers, runtime);
}

model ListProductVersionsRequest {
  fuzzy?: string(name='fuzzy'),
  pageNum?: string(name='pageNum', example='1'),
  pageSize?: string(name='pageSize', example='10'),
  platforms?: [ 
    {
      architecture?: string(name='architecture', example='amd64'),
      os?: string(name='os', example='linux'),
    }
  ](name='platforms'),
  productName?: string(name='productName', example='test-product'),
  productUID?: string(name='productUID', example='54ccb2c9-3205-4159-8c44-xxxxxxxxxxxx'),
  released?: boolean(name='released', example='true'),
  supportedFoundationTypes?: [ string ](name='supportedFoundationTypes'),
  tag?: {
    key?: string(name='key'),
    value?: string(name='value'),
  }(name='tag'),
  version?: string(name='version', example='1.0.0'),
}

model ListProductVersionsShrinkRequest {
  fuzzy?: string(name='fuzzy'),
  pageNum?: string(name='pageNum', example='1'),
  pageSize?: string(name='pageSize', example='10'),
  platformsShrink?: string(name='platforms'),
  productName?: string(name='productName', example='test-product'),
  productUID?: string(name='productUID', example='54ccb2c9-3205-4159-8c44-xxxxxxxxxxxx'),
  released?: boolean(name='released', example='true'),
  supportedFoundationTypesShrink?: string(name='supportedFoundationTypes'),
  tagShrink?: string(name='tag'),
  version?: string(name='version', example='1.0.0'),
}

model ListProductVersionsResponseBody = {
  code?: string(name='code', example='Success'),
  data?: {
    list?: [ 
      {
        annotations?: {
          additionalProp1?: string(name='additionalProp1'),
          additionalProp2?: string(name='additionalProp2'),
          additionalProp3?: string(name='additionalProp3'),
        }(name='annotations'),
        description?: string(name='description', example='test product version'),
        packageURL?: string(name='packageURL'),
        productName?: string(name='productName', example='test'),
        productUID?: string(name='productUID', example='54ccb2c9-3205-4159-8c44-xxxxxxxxxxxx'),
        provider?: string(name='provider'),
        releasedAt?: string(name='releasedAt'),
        tags?: [ 
          {
            key?: string(name='key'),
            value?: string(name='value'),
          }
        ](name='tags'),
        uid?: string(name='uid', example='e61f944c-c021-46bd-a877-xxxxxxxxxxxx'),
        version?: string(name='version', example='1.0.0'),
      }
    ](name='list'),
    pageNum?: int32(name='pageNum', example='1'),
    pageSize?: int32(name='pageSize', example='10'),
    total?: int32(name='total', example='100'),
  }(name='data'),
  msg?: string(name='msg', example='Success'),
}

model ListProductVersionsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListProductVersionsResponseBody(name='body'),
}

async function listProductVersionsWithOptions(tmpReq: ListProductVersionsRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListProductVersionsResponse {
  Util.validateModel(tmpReq);
  var request = new ListProductVersionsShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.platforms)) {
    request.platformsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.platforms, 'platforms', 'json');
  }
  if (!Util.isUnset(tmpReq.supportedFoundationTypes)) {
    request.supportedFoundationTypesShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.supportedFoundationTypes, 'supportedFoundationTypes', 'json');
  }
  if (!Util.isUnset(tmpReq.tag)) {
    request.tagShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.tag, 'tag', 'json');
  }
  var query : map[string]any = {};
  if (!Util.isUnset(request.fuzzy)) {
    query['fuzzy'] = request.fuzzy;
  }
  if (!Util.isUnset(request.pageNum)) {
    query['pageNum'] = request.pageNum;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['pageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.platformsShrink)) {
    query['platforms'] = request.platformsShrink;
  }
  if (!Util.isUnset(request.productName)) {
    query['productName'] = request.productName;
  }
  if (!Util.isUnset(request.productUID)) {
    query['productUID'] = request.productUID;
  }
  if (!Util.isUnset(request.released)) {
    query['released'] = request.released;
  }
  if (!Util.isUnset(request.supportedFoundationTypesShrink)) {
    query['supportedFoundationTypes'] = request.supportedFoundationTypesShrink;
  }
  if (!Util.isUnset(request.tagShrink)) {
    query['tag'] = request.tagShrink;
  }
  if (!Util.isUnset(request.version)) {
    query['version'] = request.version;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListProductVersions',
    version = '2021-07-20',
    protocol = 'HTTPS',
    pathname = `/api/v2/product-versions`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listProductVersions(request: ListProductVersionsRequest): ListProductVersionsResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listProductVersionsWithOptions(request, headers, runtime);
}

model ListProductsRequest {
  description?: string(name='description'),
  fuzzy?: string(name='fuzzy', example='name'),
  name?: string(name='name', example='product-name'),
  pageNum?: int32(name='pageNum', example='1'),
  pageSize?: int32(name='pageSize', example='10'),
}

model ListProductsResponseBody = {
  code?: string(name='code', example='Success'),
  data?: {
    list?: [ 
      {
        description?: string(name='description', example='test product'),
        name?: string(name='name', example='test'),
        uid?: string(name='uid', example='54ccb2c9-3205-4159-8c44-xxxxxxxxxxxx'),
      }
    ](name='list'),
    pageNum?: int32(name='pageNum', example='1'),
    pageSize?: int32(name='pageSize', example='10'),
    total?: int32(name='total', example='100'),
  }(name='data'),
  msg?: string(name='msg', example='Success'),
}

model ListProductsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListProductsResponseBody(name='body'),
}

async function listProductsWithOptions(request: ListProductsRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListProductsResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.description)) {
    query['description'] = request.description;
  }
  if (!Util.isUnset(request.fuzzy)) {
    query['fuzzy'] = request.fuzzy;
  }
  if (!Util.isUnset(request.name)) {
    query['name'] = request.name;
  }
  if (!Util.isUnset(request.pageNum)) {
    query['pageNum'] = request.pageNum;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['pageSize'] = request.pageSize;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListProducts',
    version = '2021-07-20',
    protocol = 'HTTPS',
    pathname = `/api/v2/products`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listProducts(request: ListProductsRequest): ListProductsResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listProductsWithOptions(request, headers, runtime);
}

model ListWorkflowTaskLogsRequest {
  filterValues?: [ string ](name='filterValues'),
  orderType?: string(name='orderType', example='ENUM:["positive","reverse"]'),
  pageNum?: long(name='pageNum'),
  pageSize?: long(name='pageSize', example='100'),
  workflowType?: string(name='workflowType'),
  xuid?: string(name='xuid'),
}

model ListWorkflowTaskLogsShrinkRequest {
  filterValuesShrink?: string(name='filterValues'),
  orderType?: string(name='orderType', example='ENUM:["positive","reverse"]'),
  pageNum?: long(name='pageNum'),
  pageSize?: long(name='pageSize', example='100'),
  workflowType?: string(name='workflowType'),
  xuid?: string(name='xuid'),
}

model ListWorkflowTaskLogsResponseBody = {
  code?: string(name='code'),
  data?: {
    list?: [ string ](name='list'),
    pageNum?: long(name='pageNum'),
    pageSize?: long(name='pageSize'),
    total?: long(name='total'),
  }(name='data'),
  msg?: string(name='msg'),
}

model ListWorkflowTaskLogsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListWorkflowTaskLogsResponseBody(name='body'),
}

async function listWorkflowTaskLogsWithOptions(stepName: string, taskName: string, tmpReq: ListWorkflowTaskLogsRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListWorkflowTaskLogsResponse {
  Util.validateModel(tmpReq);
  var request = new ListWorkflowTaskLogsShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.filterValues)) {
    request.filterValuesShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.filterValues, 'filterValues', 'json');
  }
  var query : map[string]any = {};
  if (!Util.isUnset(request.filterValuesShrink)) {
    query['filterValues'] = request.filterValuesShrink;
  }
  if (!Util.isUnset(request.orderType)) {
    query['orderType'] = request.orderType;
  }
  if (!Util.isUnset(request.pageNum)) {
    query['pageNum'] = request.pageNum;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['pageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.workflowType)) {
    query['workflowType'] = request.workflowType;
  }
  if (!Util.isUnset(request.xuid)) {
    query['xuid'] = request.xuid;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListWorkflowTaskLogs',
    version = '2021-07-20',
    protocol = 'HTTPS',
    pathname = `/api/v2/workflows/steps/${OpenApiUtil.getEncodeParam(stepName)}/tasks/${OpenApiUtil.getEncodeParam(taskName)}/logs`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listWorkflowTaskLogs(stepName: string, taskName: string, request: ListWorkflowTaskLogsRequest): ListWorkflowTaskLogsResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listWorkflowTaskLogsWithOptions(stepName, taskName, request, headers, runtime);
}

model PutEnvironmentTunnelRequest {
  tunnelConfig?: {
    hostname?: string(name='hostname', example='43.183.xx.xx'),
    password?: string(name='password', example='paasword'),
    regionId?: string(name='regionId', example='cn-hangzhou'),
    sshPort?: int32(name='sshPort', example='22'),
    username?: string(name='username', example='root'),
    vpcId?: string(name='vpcId', example='vpc-uf6cj8ytglguhhxxxxxxxx'),
  }(name='tunnelConfig'),
  tunnelType?: string(name='tunnelType', example='jumpServer'),
}

model PutEnvironmentTunnelResponseBody = {
  code?: string(name='code', example='Success'),
  data?: {
    uid?: string(name='uid', example='07841a56-b0e5-4241-a4a0-xxxxxxxxxxxx'),
  }(name='data'),
  msg?: string(name='msg', example='Success'),
}

model PutEnvironmentTunnelResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: PutEnvironmentTunnelResponseBody(name='body'),
}

async function putEnvironmentTunnelWithOptions(uid: string, request: PutEnvironmentTunnelRequest, headers: map[string]string, runtime: Util.RuntimeOptions): PutEnvironmentTunnelResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.tunnelConfig)) {
    body['tunnelConfig'] = request.tunnelConfig;
  }
  if (!Util.isUnset(request.tunnelType)) {
    body['tunnelType'] = request.tunnelType;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'PutEnvironmentTunnel',
    version = '2021-07-20',
    protocol = 'HTTPS',
    pathname = `/api/v2/environments/${OpenApiUtil.getEncodeParam(uid)}/tunnels`,
    method = 'PUT',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function putEnvironmentTunnel(uid: string, request: PutEnvironmentTunnelRequest): PutEnvironmentTunnelResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return putEnvironmentTunnelWithOptions(uid, request, headers, runtime);
}

model PutProductInstanceConfigRequest {
  componentUID?: string(name='componentUID'),
  componentVersionUID?: string(name='componentVersionUID'),
  configUID?: string(name='configUID'),
  description?: string(name='description'),
  environmentUID?: string(name='environmentUID'),
  name?: string(name='name'),
  parentComponentName?: string(name='parentComponentName'),
  parentComponentVersionUID?: string(name='parentComponentVersionUID'),
  productVersionUID?: string(name='productVersionUID'),
  releaseName?: string(name='releaseName'),
  scope?: [ string ](name='scope'),
  value?: string(name='value'),
  valueType?: string(name='valueType'),
}

model PutProductInstanceConfigResponseBody = {
  code?: string(name='code'),
  data?: {
    uid?: string(name='uid'),
  }(name='data'),
  msg?: string(name='msg'),
}

model PutProductInstanceConfigResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: PutProductInstanceConfigResponseBody(name='body'),
}

async function putProductInstanceConfigWithOptions(request: PutProductInstanceConfigRequest, headers: map[string]string, runtime: Util.RuntimeOptions): PutProductInstanceConfigResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.componentUID)) {
    body['componentUID'] = request.componentUID;
  }
  if (!Util.isUnset(request.componentVersionUID)) {
    body['componentVersionUID'] = request.componentVersionUID;
  }
  if (!Util.isUnset(request.configUID)) {
    body['configUID'] = request.configUID;
  }
  if (!Util.isUnset(request.description)) {
    body['description'] = request.description;
  }
  if (!Util.isUnset(request.environmentUID)) {
    body['environmentUID'] = request.environmentUID;
  }
  if (!Util.isUnset(request.name)) {
    body['name'] = request.name;
  }
  if (!Util.isUnset(request.parentComponentName)) {
    body['parentComponentName'] = request.parentComponentName;
  }
  if (!Util.isUnset(request.parentComponentVersionUID)) {
    body['parentComponentVersionUID'] = request.parentComponentVersionUID;
  }
  if (!Util.isUnset(request.productVersionUID)) {
    body['productVersionUID'] = request.productVersionUID;
  }
  if (!Util.isUnset(request.releaseName)) {
    body['releaseName'] = request.releaseName;
  }
  if (!Util.isUnset(request.scope)) {
    body['scope'] = request.scope;
  }
  if (!Util.isUnset(request.value)) {
    body['value'] = request.value;
  }
  if (!Util.isUnset(request.valueType)) {
    body['valueType'] = request.valueType;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'PutProductInstanceConfig',
    version = '2021-07-20',
    protocol = 'HTTPS',
    pathname = `/api/v2/product-instances/configs`,
    method = 'PUT',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function putProductInstanceConfig(request: PutProductInstanceConfigRequest): PutProductInstanceConfigResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return putProductInstanceConfigWithOptions(request, headers, runtime);
}

model SetEnvironmentFoundationReferenceResponseBody = {
  code?: string(name='code', example='Success'),
  msg?: string(name='msg', example='Success'),
}

model SetEnvironmentFoundationReferenceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SetEnvironmentFoundationReferenceResponseBody(name='body'),
}

async function setEnvironmentFoundationReferenceWithOptions(uid: string, foundationReferenceUID: string, headers: map[string]string, runtime: Util.RuntimeOptions): SetEnvironmentFoundationReferenceResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApi.Params{
    action = 'SetEnvironmentFoundationReference',
    version = '2021-07-20',
    protocol = 'HTTPS',
    pathname = `/api/v2/environments/${OpenApiUtil.getEncodeParam(uid)}/foundation-references/${OpenApiUtil.getEncodeParam(foundationReferenceUID)}`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function setEnvironmentFoundationReference(uid: string, foundationReferenceUID: string): SetEnvironmentFoundationReferenceResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return setEnvironmentFoundationReferenceWithOptions(uid, foundationReferenceUID, headers, runtime);
}

model UpdateDeliverableRequest {
  foundation?: {
    clusterConfig?: string(name='clusterConfig'),
    foundationReferenceUID?: string(name='foundationReferenceUID', example='1c70d948-a94f-4371-9bc1-8979b01cedfe'),
    foundationVersion?: string(name='foundationVersion', example='1.4.2'),
    foundationVersionUID?: string(name='foundationVersionUID', example='484c4a1e-69c7-4395-8e02-d461b6894076'),
    reusable?: boolean(name='reusable'),
  }(name='foundation'),
  products?: [ 
    {
      namespace?: string(name='namespace'),
      productName?: string(name='productName', example='catalog-demo'),
      productType?: string(name='productType', example='own'),
      productUID?: string(name='productUID', example='cf509b6f-fb35-428c-af8d-8c3feac4a868'),
      productVersion?: string(name='productVersion', example='0.1.11'),
      productVersionSpecName?: string(name='productVersionSpecName'),
      productVersionSpecUID?: string(name='productVersionSpecUID', example='a3ebabac-5249-47b7-9d9f-969e9b284f1c'),
      productVersionUID?: string(name='productVersionUID', example='244e3507-cc73-4709-b547-a72f41245d9a'),
    }
  ](name='products'),
  status?: string(name='status'),
}

model UpdateDeliverableResponseBody = {
  code?: string(name='code', example='Success'),
  msg?: string(name='msg', example='succeed in handling request'),
}

model UpdateDeliverableResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateDeliverableResponseBody(name='body'),
}

async function updateDeliverableWithOptions(uid: string, request: UpdateDeliverableRequest, headers: map[string]string, runtime: Util.RuntimeOptions): UpdateDeliverableResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.foundation)) {
    body['foundation'] = request.foundation;
  }
  if (!Util.isUnset(request.products)) {
    body['products'] = request.products;
  }
  if (!Util.isUnset(request.status)) {
    body['status'] = request.status;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UpdateDeliverable',
    version = '2021-07-20',
    protocol = 'HTTPS',
    pathname = `/api/v2/delivery/deliverables/${OpenApiUtil.getEncodeParam(uid)}`,
    method = 'PUT',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function updateDeliverable(uid: string, request: UpdateDeliverableRequest): UpdateDeliverableResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return updateDeliverableWithOptions(uid, request, headers, runtime);
}

model UpdateDeliveryInstanceRequest {
  deliverableConfigUID?: string(name='deliverableConfigUID', example='deliver-cfg-Y5lx8QmLLp9O'),
  deliverableUID?: string(name='deliverableUID', example='deliver-ppAzK3r8nvVp'),
  desc?: string(name='desc'),
}

model UpdateDeliveryInstanceResponseBody = {
  code?: string(name='code', example='Success'),
  msg?: string(name='msg', example='succeed in handling request'),
}

model UpdateDeliveryInstanceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateDeliveryInstanceResponseBody(name='body'),
}

async function updateDeliveryInstanceWithOptions(uid: string, request: UpdateDeliveryInstanceRequest, headers: map[string]string, runtime: Util.RuntimeOptions): UpdateDeliveryInstanceResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.deliverableConfigUID)) {
    body['deliverableConfigUID'] = request.deliverableConfigUID;
  }
  if (!Util.isUnset(request.deliverableUID)) {
    body['deliverableUID'] = request.deliverableUID;
  }
  if (!Util.isUnset(request.desc)) {
    body['desc'] = request.desc;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UpdateDeliveryInstance',
    version = '2021-07-20',
    protocol = 'HTTPS',
    pathname = `/api/v2/delivery/delivery-instances/${OpenApiUtil.getEncodeParam(uid)}`,
    method = 'PUT',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function updateDeliveryInstance(uid: string, request: UpdateDeliveryInstanceRequest): UpdateDeliveryInstanceResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return updateDeliveryInstanceWithOptions(uid, request, headers, runtime);
}

model UpdateEnvironmentRequest {
  advancedConfigs?: {
    enableDeploySimulation?: boolean(name='enableDeploySimulation'),
    enableSiteSurvey?: boolean(name='enableSiteSurvey'),
  }(name='advancedConfigs'),
  description?: string(name='description'),
  location?: string(name='location'),
  vendorConfig?: string(name='vendorConfig'),
}

model UpdateEnvironmentResponseBody = {
  code?: string(name='code', example='Success'),
  msg?: string(name='msg', example='Success'),
}

model UpdateEnvironmentResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateEnvironmentResponseBody(name='body'),
}

async function updateEnvironmentWithOptions(uid: string, request: UpdateEnvironmentRequest, headers: map[string]string, runtime: Util.RuntimeOptions): UpdateEnvironmentResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.advancedConfigs)) {
    body['advancedConfigs'] = request.advancedConfigs;
  }
  if (!Util.isUnset(request.description)) {
    body['description'] = request.description;
  }
  if (!Util.isUnset(request.location)) {
    body['location'] = request.location;
  }
  if (!Util.isUnset(request.vendorConfig)) {
    body['vendorConfig'] = request.vendorConfig;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UpdateEnvironment',
    version = '2021-07-20',
    protocol = 'HTTPS',
    pathname = `/api/v2/environments/${OpenApiUtil.getEncodeParam(uid)}`,
    method = 'PUT',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function updateEnvironment(uid: string, request: UpdateEnvironmentRequest): UpdateEnvironmentResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return updateEnvironmentWithOptions(uid, request, headers, runtime);
}

model UpdateEnvironmentNodeRequest {
  applicationDisk?: string(name='applicationDisk', example='/dev/vdb'),
  etcdDisk?: string(name='etcdDisk', example='/dev/vdc'),
  labels?: map[string]any(name='labels', example='{"key1":"value1","key2":"value2"}'),
  rootPassword?: string(name='rootPassword', example='rootPassword'),
  taints?: [ 
    {
      effect?: string(name='effect', example='NoSchedule'),
      key?: string(name='key', example='key'),
      value?: string(name='value', example='value'),
    }
  ](name='taints'),
  tridentSystemDisk?: string(name='tridentSystemDisk', example='/dev/vdb'),
  tridentSystemSizeDisk?: int32(name='tridentSystemSizeDisk', example='400'),
}

model UpdateEnvironmentNodeResponseBody = {
  code?: string(name='code', example='Success'),
  msg?: string(name='msg', example='Success'),
}

model UpdateEnvironmentNodeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateEnvironmentNodeResponseBody(name='body'),
}

async function updateEnvironmentNodeWithOptions(uid: string, nodeUID: string, request: UpdateEnvironmentNodeRequest, headers: map[string]string, runtime: Util.RuntimeOptions): UpdateEnvironmentNodeResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.applicationDisk)) {
    body['applicationDisk'] = request.applicationDisk;
  }
  if (!Util.isUnset(request.etcdDisk)) {
    body['etcdDisk'] = request.etcdDisk;
  }
  if (!Util.isUnset(request.labels)) {
    body['labels'] = request.labels;
  }
  if (!Util.isUnset(request.rootPassword)) {
    body['rootPassword'] = request.rootPassword;
  }
  if (!Util.isUnset(request.taints)) {
    body['taints'] = request.taints;
  }
  if (!Util.isUnset(request.tridentSystemDisk)) {
    body['tridentSystemDisk'] = request.tridentSystemDisk;
  }
  if (!Util.isUnset(request.tridentSystemSizeDisk)) {
    body['tridentSystemSizeDisk'] = request.tridentSystemSizeDisk;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UpdateEnvironmentNode',
    version = '2021-07-20',
    protocol = 'HTTPS',
    pathname = `/api/v2/environments/${OpenApiUtil.getEncodeParam(uid)}/nodes/${OpenApiUtil.getEncodeParam(nodeUID)}`,
    method = 'PUT',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function updateEnvironmentNode(uid: string, nodeUID: string, request: UpdateEnvironmentNodeRequest): UpdateEnvironmentNodeResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return updateEnvironmentNodeWithOptions(uid, nodeUID, request, headers, runtime);
}

model UpdateEnvironmentProductVersionRequest {
  oldProductVersionSpecUID?: string(name='oldProductVersionSpecUID'),
  oldProductVersionUID?: string(name='oldProductVersionUID', example='9cb5d348-7c0a-4428-8ed1-xxx'),
  productVersionSpecUID?: string(name='productVersionSpecUID'),
  productVersionUID?: string(name='productVersionUID', example='1280876d-d548-45cb-bd90-xxx'),
}

model UpdateEnvironmentProductVersionResponseBody = {
  code?: string(name='code', example='Success'),
  msg?: string(name='msg', example='Success'),
}

model UpdateEnvironmentProductVersionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateEnvironmentProductVersionResponseBody(name='body'),
}

async function updateEnvironmentProductVersionWithOptions(uid: string, request: UpdateEnvironmentProductVersionRequest, headers: map[string]string, runtime: Util.RuntimeOptions): UpdateEnvironmentProductVersionResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.oldProductVersionSpecUID)) {
    body['oldProductVersionSpecUID'] = request.oldProductVersionSpecUID;
  }
  if (!Util.isUnset(request.oldProductVersionUID)) {
    body['oldProductVersionUID'] = request.oldProductVersionUID;
  }
  if (!Util.isUnset(request.productVersionSpecUID)) {
    body['productVersionSpecUID'] = request.productVersionSpecUID;
  }
  if (!Util.isUnset(request.productVersionUID)) {
    body['productVersionUID'] = request.productVersionUID;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UpdateEnvironmentProductVersion',
    version = '2021-07-20',
    protocol = 'HTTPS',
    pathname = `/api/v2/environments/${OpenApiUtil.getEncodeParam(uid)}/product-versions`,
    method = 'PUT',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function updateEnvironmentProductVersion(uid: string, request: UpdateEnvironmentProductVersionRequest): UpdateEnvironmentProductVersionResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return updateEnvironmentProductVersionWithOptions(uid, request, headers, runtime);
}

model UpdateFoundationComponentReferenceRequest {
  componentOrchestrationValues?: string(name='componentOrchestrationValues'),
  enable?: boolean(name='enable', example='false'),
}

model UpdateFoundationComponentReferenceResponseBody = {
  code?: string(name='code', example='Success'),
  msg?: string(name='msg', example='Success'),
}

model UpdateFoundationComponentReferenceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateFoundationComponentReferenceResponseBody(name='body'),
}

async function updateFoundationComponentReferenceWithOptions(uid: string, componentReferenceUID: string, request: UpdateFoundationComponentReferenceRequest, headers: map[string]string, runtime: Util.RuntimeOptions): UpdateFoundationComponentReferenceResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.componentOrchestrationValues)) {
    body['componentOrchestrationValues'] = request.componentOrchestrationValues;
  }
  if (!Util.isUnset(request.enable)) {
    body['enable'] = request.enable;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UpdateFoundationComponentReference',
    version = '2021-07-20',
    protocol = 'HTTPS',
    pathname = `/api/v2/foundation-references/${OpenApiUtil.getEncodeParam(uid)}/components/${OpenApiUtil.getEncodeParam(componentReferenceUID)}`,
    method = 'PUT',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function updateFoundationComponentReference(uid: string, componentReferenceUID: string, request: UpdateFoundationComponentReferenceRequest): UpdateFoundationComponentReferenceResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return updateFoundationComponentReferenceWithOptions(uid, componentReferenceUID, request, headers, runtime);
}

model UpdateFoundationReferenceRequest {
  clusterConfig?: string(name='clusterConfig'),
}

model UpdateFoundationReferenceResponseBody = {
  code?: string(name='code', example='Success'),
  msg?: string(name='msg', example='Success'),
}

model UpdateFoundationReferenceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateFoundationReferenceResponseBody(name='body'),
}

async function updateFoundationReferenceWithOptions(uid: string, request: UpdateFoundationReferenceRequest, headers: map[string]string, runtime: Util.RuntimeOptions): UpdateFoundationReferenceResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.clusterConfig)) {
    body['clusterConfig'] = request.clusterConfig;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UpdateFoundationReference',
    version = '2021-07-20',
    protocol = 'HTTPS',
    pathname = `/api/v2/foundation-references/${OpenApiUtil.getEncodeParam(uid)}`,
    method = 'PUT',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function updateFoundationReference(uid: string, request: UpdateFoundationReferenceRequest): UpdateFoundationReferenceResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return updateFoundationReferenceWithOptions(uid, request, headers, runtime);
}

model UpdateProductRequest {
  categories?: [ string ](name='categories'),
  description?: string(name='description'),
  displayName?: string(name='displayName'),
  vendor?: string(name='vendor'),
}

model UpdateProductResponseBody = {
  code?: string(name='code', example='Success'),
  msg?: string(name='msg', example='Success'),
}

model UpdateProductResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateProductResponseBody(name='body'),
}

async function updateProductWithOptions(uid: string, request: UpdateProductRequest, headers: map[string]string, runtime: Util.RuntimeOptions): UpdateProductResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.categories)) {
    body['categories'] = request.categories;
  }
  if (!Util.isUnset(request.description)) {
    body['description'] = request.description;
  }
  if (!Util.isUnset(request.displayName)) {
    body['displayName'] = request.displayName;
  }
  if (!Util.isUnset(request.vendor)) {
    body['vendor'] = request.vendor;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UpdateProduct',
    version = '2021-07-20',
    protocol = 'HTTPS',
    pathname = `/api/v2/products/${OpenApiUtil.getEncodeParam(uid)}`,
    method = 'PUT',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function updateProduct(uid: string, request: UpdateProductRequest): UpdateProductResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return updateProductWithOptions(uid, request, headers, runtime);
}

model UpdateProductComponentVersionRequest {
  componentOrchestrationValues?: string(name='componentOrchestrationValues', example='replicaCount: 2\\n\\nresources:\\n  limits:\\n    cpu: 200m\\n    memory: 512Mi\\n  requests:\\n    cpu: 100m\\n    memory: 256Mi'),
  componentSpecificationUid?: string(name='componentSpecificationUid'),
  componentSpecificationValues?: string(name='componentSpecificationValues'),
  enable?: boolean(name='enable', example='true'),
  newComponentVersionUID?: string(name='newComponentVersionUID', example='9963a9ec-95d0-4e82-88c8-xxxxxxxxxxxx'),
  policy?: {
    multiCluster?: {
      autoInstall?: boolean(name='autoInstall'),
      targetClusters?: [ string ](name='targetClusters'),
    }(name='multiCluster'),
  }(name='policy'),
  releaseName?: string(name='releaseName', example='component-release'),
  unsetComponentVersionSpec?: boolean(name='unsetComponentVersionSpec'),
}

model UpdateProductComponentVersionResponseBody = {
  code?: string(name='code', example='Success'),
  data?: {
    relationUID?: string(name='relationUID', example='85f035f0-7a56-478c-8869-xxxxxxxxxxxx'),
  }(name='data'),
  msg?: string(name='msg', example='Success'),
}

model UpdateProductComponentVersionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateProductComponentVersionResponseBody(name='body'),
}

async function updateProductComponentVersionWithOptions(uid: string, relationUID: string, request: UpdateProductComponentVersionRequest, headers: map[string]string, runtime: Util.RuntimeOptions): UpdateProductComponentVersionResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.componentOrchestrationValues)) {
    body['componentOrchestrationValues'] = request.componentOrchestrationValues;
  }
  if (!Util.isUnset(request.componentSpecificationUid)) {
    body['componentSpecificationUid'] = request.componentSpecificationUid;
  }
  if (!Util.isUnset(request.componentSpecificationValues)) {
    body['componentSpecificationValues'] = request.componentSpecificationValues;
  }
  if (!Util.isUnset(request.enable)) {
    body['enable'] = request.enable;
  }
  if (!Util.isUnset(request.newComponentVersionUID)) {
    body['newComponentVersionUID'] = request.newComponentVersionUID;
  }
  if (!Util.isUnset(request.policy)) {
    body['policy'] = request.policy;
  }
  if (!Util.isUnset(request.releaseName)) {
    body['releaseName'] = request.releaseName;
  }
  if (!Util.isUnset(request.unsetComponentVersionSpec)) {
    body['unsetComponentVersionSpec'] = request.unsetComponentVersionSpec;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UpdateProductComponentVersion',
    version = '2021-07-20',
    protocol = 'HTTPS',
    pathname = `/api/v2/product-versions/${OpenApiUtil.getEncodeParam(uid)}/relations/${OpenApiUtil.getEncodeParam(relationUID)}`,
    method = 'PUT',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function updateProductComponentVersion(uid: string, relationUID: string, request: UpdateProductComponentVersionRequest): UpdateProductComponentVersionResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return updateProductComponentVersionWithOptions(uid, relationUID, request, headers, runtime);
}

model UpdateProductFoundationVersionRequest {
  foundationVersionUID?: string(name='foundationVersionUID', example='796f9044-8684-4de5-9b12-xxxxxxxxxxxx'),
}

model UpdateProductFoundationVersionResponseBody = {
  code?: string(name='code', example='Success'),
  msg?: string(name='msg', example='Success'),
}

model UpdateProductFoundationVersionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateProductFoundationVersionResponseBody(name='body'),
}

/**
  * @deprecated
  *
  * @param request UpdateProductFoundationVersionRequest
  * @param headers map
  * @param runtime runtime options for this request RuntimeOptions
  * @return UpdateProductFoundationVersionResponse
 */
// Deprecated
async function updateProductFoundationVersionWithOptions(uid: string, request: UpdateProductFoundationVersionRequest, headers: map[string]string, runtime: Util.RuntimeOptions): UpdateProductFoundationVersionResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.foundationVersionUID)) {
    body['foundationVersionUID'] = request.foundationVersionUID;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UpdateProductFoundationVersion',
    version = '2021-07-20',
    protocol = 'HTTPS',
    pathname = `/api/v2/product-versions/${OpenApiUtil.getEncodeParam(uid)}/foundation`,
    method = 'PUT',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
  * @deprecated
  *
  * @param request UpdateProductFoundationVersionRequest
  * @return UpdateProductFoundationVersionResponse
 */
// Deprecated
async function updateProductFoundationVersion(uid: string, request: UpdateProductFoundationVersionRequest): UpdateProductFoundationVersionResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return updateProductFoundationVersionWithOptions(uid, request, headers, runtime);
}

model UpdateProductVersionRequest {
  action?: string(name='action'),
  continuousIntegration?: boolean(name='continuousIntegration'),
  description?: string(name='description'),
  entry?: string(name='entry'),
  timeout?: long(name='timeout'),
  version?: string(name='version', example='1.0.0'),
}

model UpdateProductVersionResponseBody = {
  code?: string(name='code', example='Success'),
  msg?: string(name='msg', example='Success'),
}

model UpdateProductVersionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateProductVersionResponseBody(name='body'),
}

async function updateProductVersionWithOptions(uid: string, request: UpdateProductVersionRequest, headers: map[string]string, runtime: Util.RuntimeOptions): UpdateProductVersionResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.action)) {
    query['action'] = request.action;
  }

  var body : map[string]any = {};
  if (!Util.isUnset(request.continuousIntegration)) {
    body['continuousIntegration'] = request.continuousIntegration;
  }
  if (!Util.isUnset(request.description)) {
    body['description'] = request.description;
  }
  if (!Util.isUnset(request.entry)) {
    body['entry'] = request.entry;
  }
  if (!Util.isUnset(request.timeout)) {
    body['timeout'] = request.timeout;
  }
  if (!Util.isUnset(request.version)) {
    body['version'] = request.version;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UpdateProductVersion',
    version = '2021-07-20',
    protocol = 'HTTPS',
    pathname = `/api/v2/product-versions/${OpenApiUtil.getEncodeParam(uid)}`,
    method = 'PUT',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function updateProductVersion(uid: string, request: UpdateProductVersionRequest): UpdateProductVersionResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return updateProductVersionWithOptions(uid, request, headers, runtime);
}

model UpdateProductVersionConfigRequest {
  componentVersionUID?: string(name='componentVersionUID', example='9963a9ec-95d0-4e82-88c8-xxxxxxxxxxxx'),
  description?: string(name='description', example='config'),
  name?: string(name='name', example='key'),
  parentComponentVersionUID?: string(name='parentComponentVersionUID', example='d415e042-c4be-4707-9bda-xxxxxxxxxxxx'),
  value?: string(name='value', example='value'),
  valueType?: string(name='valueType', example='string'),
}

model UpdateProductVersionConfigResponseBody = {
  code?: string(name='code', example='Success'),
  msg?: string(name='msg', example='Success'),
  requestId?: string(name='requestId', example='C2B58140-529E-5335-B998-xxxxxxxxxxxx'),
}

model UpdateProductVersionConfigResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateProductVersionConfigResponseBody(name='body'),
}

async function updateProductVersionConfigWithOptions(uid: string, configUID: string, request: UpdateProductVersionConfigRequest, headers: map[string]string, runtime: Util.RuntimeOptions): UpdateProductVersionConfigResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.componentVersionUID)) {
    body['componentVersionUID'] = request.componentVersionUID;
  }
  if (!Util.isUnset(request.description)) {
    body['description'] = request.description;
  }
  if (!Util.isUnset(request.name)) {
    body['name'] = request.name;
  }
  if (!Util.isUnset(request.parentComponentVersionUID)) {
    body['parentComponentVersionUID'] = request.parentComponentVersionUID;
  }
  if (!Util.isUnset(request.value)) {
    body['value'] = request.value;
  }
  if (!Util.isUnset(request.valueType)) {
    body['valueType'] = request.valueType;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UpdateProductVersionConfig',
    version = '2021-07-20',
    protocol = 'HTTPS',
    pathname = `/api/v2/product-versions/${OpenApiUtil.getEncodeParam(uid)}/configs/${OpenApiUtil.getEncodeParam(configUID)}`,
    method = 'PUT',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function updateProductVersionConfig(uid: string, configUID: string, request: UpdateProductVersionConfigRequest): UpdateProductVersionConfigResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return updateProductVersionConfigWithOptions(uid, configUID, request, headers, runtime);
}

model ValidateEnvironmentTunnelRequest {
  tunnelConfig?: {
    hostname?: string(name='hostname', example='43.183.xx.xx'),
    password?: string(name='password', example='password'),
    regionId?: string(name='regionId', example='cn-hangzhou'),
    sshPort?: int32(name='sshPort', example='22'),
    username?: string(name='username', example='root'),
    vpcId?: string(name='vpcId', example='vpc-uf6cj8ytglguhhxxxxxxxx'),
  }(name='tunnelConfig'),
  tunnelType?: string(name='tunnelType', example='jumpServer'),
}

model ValidateEnvironmentTunnelResponseBody = {
  code?: string(name='code', example='Success'),
  msg?: string(name='msg', example='Success'),
}

model ValidateEnvironmentTunnelResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ValidateEnvironmentTunnelResponseBody(name='body'),
}

async function validateEnvironmentTunnelWithOptions(uid: string, request: ValidateEnvironmentTunnelRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ValidateEnvironmentTunnelResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.tunnelConfig)) {
    body['tunnelConfig'] = request.tunnelConfig;
  }
  if (!Util.isUnset(request.tunnelType)) {
    body['tunnelType'] = request.tunnelType;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ValidateEnvironmentTunnel',
    version = '2021-07-20',
    protocol = 'HTTPS',
    pathname = `/api/v2/environments/${OpenApiUtil.getEncodeParam(uid)}/tunnels/validation`,
    method = 'PUT',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function validateEnvironmentTunnel(uid: string, request: ValidateEnvironmentTunnelRequest): ValidateEnvironmentTunnelResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return validateEnvironmentTunnelWithOptions(uid, request, headers, runtime);
}

